private async Task <(FullAlbum album, IEnumerable <SpotifyTrackInfo> infos)> GetSpotifyInfos(string id, int startIndex, int maxResults) { FullAlbum album = await this.RunConfig.Api.GetAlbumAsync(id); IEnumerable <SpotifyTrackInfo> sourceTracks = album.Tracks.Items.Select(track => new SpotifyTrackInfo(track)); IEnumerable <SpotifyTrackInfo> infos = await SpotifyCollectionHandler.GetAllSpotifyInfosAsync(sourceTracks, id, new CollectionOptions(album.Tracks.Total, startIndex, maxResults), this.CollectionGetter); return(album, infos); }
private async Task <(FullPlaylist playlist, IEnumerable <SpotifyTrackInfo> infos)> GetSpotifyInfos(string id, int startIndex, int maxResults) { FullPlaylist playlist = await this.RunConfig.Api.GetPlaylistAsync(null, id); IEnumerable <SpotifyTrackInfo> sourceTracks = playlist.Tracks.Items.Select(playlistTrack => new SpotifyTrackInfo(playlistTrack.Track)); IEnumerable <SpotifyTrackInfo> infos = await SpotifyCollectionHandler.GetAllSpotifyInfosAsync(sourceTracks, id, new CollectionOptions(playlist.Tracks.Total, startIndex, maxResults), this.CollectionGetter); return(playlist, infos); }