Exemplo n.º 1
0
        internal Track CreateAthameTrack(TidalServiceSettings settings)
        {
            // Always put main artists in the artist field
            var t = new Track
            {
                DiscNumber     = VolumeNumber,
                TrackNumber    = TrackNumber,
                Title          = NameHelpers.CreateTrackTitle(settings, this),
                Id             = Id.ToString(),
                IsDownloadable = AllowStreaming,
                // Only use first artist name and picture for now
                Artist         = NameHelpers.CreateMainArtist(Artists, Artist),
                CustomMetadata = new[]
                {
                    MetadataHelpers.ExplicitMetadata(Explicit),
                    MetadataHelpers.MasterMetadata(AudioQuality)
                }
            };



            // If the featured artists aren't already in the title, append them there
            if (!EnglishArtistNameJoiner.DoesTitleContainArtistString(this))
            {
                var nonMainArtists = (from artist in Artists
                                      where artist.Type != ArtistRole.Main
                                      select artist.Name).ToArray();
                if (nonMainArtists.Length > 0)
                {
                    t.Title += " " + EnglishArtistNameJoiner.JoinFeaturingArtists(nonMainArtists);
                }
            }
            t.Album = Album.CreateAthameAlbum(settings);
            return(t);
        }
Exemplo n.º 2
0
 internal static Artist CreateMainArtist(List <FeaturedArtist> artists, FeaturedArtist defaultArtist)
 {
     return(new Artist
     {
         Id = defaultArtist.Id.ToString(),
         Name = EnglishArtistNameJoiner.JoinArtistNames((from artist in artists
                                                         where artist.Type == ArtistRole.Main
                                                         select artist.Name).ToArray())
     });
 }