예제 #1
0
        public override YandexMusicAlbum ToYmAlbum(IYandexMusicPlaylistLoader loader)
        {
            var artwork = CoverUri;

            if (string.IsNullOrEmpty(artwork))
            {
                artwork = OgImage;
            }

            return(new YandexMusicAlbum(Id, Year, Artists, artwork, TrackCount, Genre, Title,
                                        Tracks.SelectMany(list => list).Select(track => track.ToYmTrack()).ToList()));
        }
 public virtual YandexMusicAlbum ToYmAlbum(IYandexMusicPlaylistLoader loader)
 {
     return(new(Id, Year, Artists, CoverUri, TrackCount, Genre, Title, loader));
 }
예제 #3
0
 public virtual YandexMusicPlaylist ToYaPlaylist(IYandexMusicPlaylistLoader loader)
 {
     return(new(Uid, Kind, TrackCount, Title, Owner, Cover.GetCoverUrl(), loader));
 }
 internal YandexMusicAlbum(long id, long year, List <YandexMusicArtist> artists, string?artworkUrl, long trackCount, string genre, string title,
                           IYandexMusicPlaylistLoader loader) : base(async() => (await loader.LoadAlbum(id.ToString())) !.Data.ToList())
예제 #5
0
 internal YandexMusicPlaylist(long uid, long kind, long trackCount, string title, YandexMusicOwner owner, string?artworkUrl,
                              IYandexMusicPlaylistLoader loader) :
     base(async() => (await loader.LoadPlaylist(owner.Login, kind.ToString())) !.Data.ToList())
예제 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="YandexMusicSearchResultLoader"/> class.
 /// </summary>
 /// <param name="config">Config instance for performing requests</param>
 /// <param name="playlistLoader">Playlist loader instance for resolving albums and playlists</param>
 public YandexMusicSearchResultLoader(IYandexConfig config, IYandexMusicPlaylistLoader playlistLoader)
 {
     _playlistLoader = playlistLoader;
     config.Load();
     _config = config;
 }