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); }
public async Task <AudioFeatures> Handle(GetTrackAudioFeaturesQuery request, CancellationToken cancellationToken) { return(await _spotifyService.GetTrackAudioFeature(request.TarckId)); }