예제 #1
0
        public async Task AddTracks(AddTracksRequest request)
        {
            var page   = 0;
            var tracks = request.Tracks.Take(SpotifyApi.PageLimit);

            while (tracks.Any())
            {
                var pagedTrackRequest = new AddTracksRequest {
                    PlaylistId = request.PlaylistId, Tracks = tracks.ToArray()
                };
                await _spotifyWebApi.AddTracks(pagedTrackRequest, Token);

                page++;
                tracks = request.Tracks.Skip(SpotifyApi.PageLimit * page).Take(SpotifyApi.PageLimit);
            }
        }