Esempio n. 1
0
        public async Task <List <AvarageAudioAnalysis> > GetPlaylistAudioAnalysis(string playlistId)
        {
            var playlist = await GetPlaylistSimplifiedAsync(playlistId);

            var result = new List <AvarageAudioAnalysis>();
            PagingModel <PlayListTrackSimplified> currentPage = playlist.Tracks;

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

                currentPage = await GetNextPage(currentPage.Next);
            }

            return(result);
        }
Esempio n. 2
0
 public async Task <AvarageAudioAnalysis> Handle(GetTrackAvarageAudioAnalysisQuery request, CancellationToken cancellationToken)
 {
     return(await _spotifyTracksService.GetTrackAvarageAudioAnalysis(request.TrackId));
 }