public interface MusicFetcher
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordAn object to hold a name and artist combination. -
Method Summary
Modifier and TypeMethodDescriptionfetchAlbum(String name, String artist) Gets anAlbumfrom a given name and artist.fetchAlbumById(String id) Gets anAlbumfrom a given ID.fetchAlbumTracks(Album album) Gets all tracks from a givenAlbum.Gets anArtistfrom a given ID.fetchArtistByName(String name) Gets anArtistfrom a given name.fetchPlaylist(String name, String author) Gets aPlaylistfrom a given name and author.Gets aPlaylistfrom a given ID.fetchPlaylistTracks(Playlist playlist) Gets all tracks from a givenPlaylist.fetchTrack(String name, String artist) Gets aTrackfrom a given name and artist.fetchTrackById(String id) Gets aTrackfrom a given ID, specific to the service provider implementation.fetchTracks(List<MusicFetcher.TrackNameArtist> tracks) Gets multipleTracks from a given list ofMusicFetcher.TrackNameArtists.fetchTracksById(List<String> trackIds) Gets multipleTracks from a given list of IDs.
-
Method Details
-
fetchTrack
Gets aTrackfrom a given name and artist. If multiple tracks are found with the name/artist combination, it is up to the implementation to decide what to pick.- Parameters:
name- The name of the track, not including the artist nameartist- The name of the artist- Returns:
- The track with the given name and artist, if any
-
fetchTrackById
-
fetchTracks
Gets multipleTracks from a given list ofMusicFetcher.TrackNameArtists. This effectively performs whatfetchTrack(String, String)does, but batched for multiple tracks at once.- Parameters:
tracks- The tracks to look up- Returns:
- The list of tracks that were found, in the same order as the given list of tracks. If a track isn't found, it is skipped
-
fetchTracksById
Gets multipleTracks from a given list of IDs. This effectively performs whatfetchTrackById(String)does, but batched for multiple tracks at once. The IDs are in different formats for each service provider.- Parameters:
trackIds- The IDs of the tracks to look up- Returns:
- The list of tracks that were found, in the same order as the given list of track IDs. If a track isn't found, it is skipped.
-
fetchPlaylist
Gets aPlaylistfrom a given name and author. If multiple playlists are found with the name/author combination, it is up to the implementation to decide what to pick. If multiple playlists are found with the same name, it is up to the implementation to decide what to pick.- Parameters:
name- The name of the playlistauthor- The name of the artist- Returns:
- The playlist with the given name and author, if any
-
fetchPlaylistById
Gets aPlaylistfrom a given ID. This is in different formats for each service provider implementation.- Parameters:
id- The ID of the playlist. This is in different formats for each service provider implementation- Returns:
- The playlist with the given ID, if any
-
fetchAlbum
Gets anAlbumfrom a given name and artist. If multiple albums are found with the name/artist combination, it is up to the implementation to decide what to pick. If multiple albums are found with the same name, it is up to the implementation to decide what to pick.- Parameters:
name- The name of the album, not including the artist nameartist- The name of the artist- Returns:
- The album with the given name and artist, if any
-
fetchAlbumById
-
fetchAlbumTracks
-
fetchPlaylistTracks
-
fetchArtistById
Gets anArtistfrom a given ID. This is in different formats for each service provider implementation.- Parameters:
id- The ID of the artist. This is in different formats for each service provider implementation.- Returns:
- The artist with the given ID, if any
-
fetchArtistByName
-