예제 #1
0
        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);
        }
예제 #2
0
        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);
        }