more work on generic MediaProvider interface
This commit is contained in:
@@ -34,7 +34,9 @@ type Favorites struct {
|
|||||||
type MediaProvider interface {
|
type MediaProvider interface {
|
||||||
GetAlbum(albumID string) (*AlbumWithTracks, error)
|
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)
|
GetPlaylist(playlistID string) (*PlaylistWithTracks, error)
|
||||||
|
|
||||||
@@ -56,9 +58,21 @@ type MediaProvider interface {
|
|||||||
|
|
||||||
GetFavorites() (Favorites, error)
|
GetFavorites() (Favorites, error)
|
||||||
|
|
||||||
GetPlaylists() ([]Playlist, error)
|
|
||||||
|
|
||||||
SetFavorite(params RatingFavoriteParameters) error
|
SetFavorite(params RatingFavoriteParameters) error
|
||||||
|
|
||||||
SetRating(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 {
|
type Artist struct {
|
||||||
ID string
|
ID string
|
||||||
Name string
|
Name string
|
||||||
|
AlbumCount int
|
||||||
|
}
|
||||||
|
|
||||||
|
type ArtistWithAlbums struct {
|
||||||
|
Artist
|
||||||
Albums []Album
|
Albums []Album
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ArtistInfo struct {
|
||||||
|
Biography string
|
||||||
|
LastFMUrl string
|
||||||
|
ImageURL string
|
||||||
|
SimilarArtists []Artist
|
||||||
|
}
|
||||||
|
|
||||||
type Genre struct {
|
type Genre struct {
|
||||||
Name string
|
Name string
|
||||||
AlbumCount int
|
AlbumCount int
|
||||||
@@ -39,10 +51,11 @@ type Track struct {
|
|||||||
Genre string
|
Genre string
|
||||||
ArtistIDs []string
|
ArtistIDs []string
|
||||||
ArtistNames []string
|
ArtistNames []string
|
||||||
|
Album string
|
||||||
Rating int
|
Rating int
|
||||||
Favorite bool
|
Favorite bool
|
||||||
Size int64
|
Size int64
|
||||||
PlayCount int64
|
PlayCount int
|
||||||
FilePath string
|
FilePath string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user