more work on generic MediaProvider interface
This commit is contained in:
@@ -34,7 +34,9 @@ type Favorites struct {
|
||||
type MediaProvider interface {
|
||||
GetAlbum(albumID string) (*AlbumWithTracks, error)
|
||||
|
||||
GetArtist(artistID string) (*Artist, error)
|
||||
GetArtist(artistID string) (*ArtistWithAlbums, error)
|
||||
|
||||
GetArtistInfo(artistID string) (*ArtistInfo, error)
|
||||
|
||||
GetPlaylist(playlistID string) (*PlaylistWithTracks, error)
|
||||
|
||||
@@ -56,9 +58,21 @@ type MediaProvider interface {
|
||||
|
||||
GetFavorites() (Favorites, error)
|
||||
|
||||
GetPlaylists() ([]Playlist, error)
|
||||
|
||||
SetFavorite(params RatingFavoriteParameters) error
|
||||
|
||||
SetRating(params RatingFavoriteParameters) error
|
||||
|
||||
GetPlaylists() ([]Playlist, error)
|
||||
|
||||
CreatePlaylist(name string, trackIDs []string) error
|
||||
|
||||
EditPlaylist(id, name, description string, public bool) error
|
||||
|
||||
EditPlaylistTracks(id string, trackIDsToAdd, trackIDsToRemove []string) error
|
||||
|
||||
ReplacePlaylistTracks(id string, trackIDs []string) error
|
||||
|
||||
DeletePlaylist(id string) error
|
||||
|
||||
Scrobble(trackID string, submission bool) error
|
||||
}
|
||||
|
||||
@@ -19,11 +19,23 @@ type AlbumWithTracks struct {
|
||||
}
|
||||
|
||||
type Artist struct {
|
||||
ID string
|
||||
Name string
|
||||
ID string
|
||||
Name string
|
||||
AlbumCount int
|
||||
}
|
||||
|
||||
type ArtistWithAlbums struct {
|
||||
Artist
|
||||
Albums []Album
|
||||
}
|
||||
|
||||
type ArtistInfo struct {
|
||||
Biography string
|
||||
LastFMUrl string
|
||||
ImageURL string
|
||||
SimilarArtists []Artist
|
||||
}
|
||||
|
||||
type Genre struct {
|
||||
Name string
|
||||
AlbumCount int
|
||||
@@ -39,10 +51,11 @@ type Track struct {
|
||||
Genre string
|
||||
ArtistIDs []string
|
||||
ArtistNames []string
|
||||
Album string
|
||||
Rating int
|
||||
Favorite bool
|
||||
Size int64
|
||||
PlayCount int64
|
||||
PlayCount int
|
||||
FilePath string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user