using Sony.Filtr.ApolloAPI; using Sony.Filtr.Buzz; using Sony.Filtr.Contracts.Abstractions; using Sony.Filtr.Contracts.Entities; using Sony.Filtr.Core.Buzz; using Sony.Filtr.Core.EditorialPlaylists; using Sony.Filtr.Core.SpotifyUserCountries; using Sony.Filtr.Core.SpotifyWeekly; using Sony.Filtr.Core.TrackPopularity; using Sony.Filtr.Playlists; using Sony.Filtr.Playlists.Spotify; using Sony.Filtr.SpotifyImages; using Sony.Filtr.SpotifyWebAPI; using Sony.Filtr.Tasks.Helpers; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; using System.Linq; using System.Threading.Tasks; namespace Sony.Filtr.Tasks.Tasks { public class UpdatePlaylistInfoWithVendorAPIReadIdsFromFile : UpdatePlaylistInfoWithVendorAPI { public UpdatePlaylistInfoWithVendorAPIReadIdsFromFile( SpotifyWebApi spotifyWebApi, IApolloWebApi apolloWebApi, EditorialPlaylistManager editorialPlaylistManager, SpotifyPlaylistManager spotifyPlaylistManager, SpotifyUserCountryManager spotifyUserCountryManager, BuzzAccountManager buzzAccountManager, IServiceAccountManager serviceAccountManager, SpotifyTrackPopularityManager spotifyTrackPopularityManager, SpotifyImageDownloader spotifyImageHandler, BuzzManager buzzManager, SpotifyPlaylistHistoricTrackListManager historicTrackListManager, IgnoredPlaylistsManager ignoredPlaylistsManager, UpdatePlaylistsHelper updatePlaylistsHelper, SpotifyWeeklyManager spotifyWeeklyManager) : base(spotifyWebApi, apolloWebApi, editorialPlaylistManager, spotifyPlaylistManager, spotifyUserCountryManager, buzzAccountManager, serviceAccountManager, spotifyTrackPopularityManager, spotifyImageHandler, buzzManager, historicTrackListManager, ignoredPlaylistsManager, updatePlaylistsHelper, spotifyWeeklyManager) { } protected override bool PreloadAlbumsAndArtists => false; protected override bool DoFinalCleanup => false; internal override async Task> GetPlaylistToProcessAsync() { return (await _spotifyPlaylistManager.GetPlaylistsFor(File.ReadLines("PlaylistIdsToReprocess.csv"))) .Select((playlist, index) => new SpotifyPlaylistInput( new PlaylistMarker(playlist.PlaylistId, "Artem", playlist.CountryCode, index), new ReadOnlyCollection(new EditorialPlaylist[0]), true)) .ToList(); } } }