Ejemplo n.º 1
0
        public async Task <List <AudioFeatures> > GetPlayListAudioFeatures(string playlistId)
        {
            var playlist = await GetPlaylistSimplifiedAsync(playlistId);

            List <AudioFeatures> result = new List <AudioFeatures>();

            PagingModel <PlayListTrackSimplified> currentPage = playlist.Tracks;

            while (currentPage.Items != null)
            {
                foreach (var track in currentPage.Items)
                {
                    result.Add(await _spotifyTracksService.GetTrackAudioFeature(track.Track.Id));
                }

                currentPage = await GetNextPage(currentPage.Next);
            }

            return(result);
        }
Ejemplo n.º 2
0
 public async Task <AudioFeatures> Handle(GetTrackAudioFeaturesQuery request, CancellationToken cancellationToken)
 {
     return(await _spotifyService.GetTrackAudioFeature(request.TarckId));
 }