示例#1
0
        public static NzbDrone.Core.Music.Artist ToModel(this ArtistResource resource, NzbDrone.Core.Music.Artist artist)
        {
            var updatedArtist = resource.ToModel();

            artist.ApplyChanges(updatedArtist);

            return(artist);
        }
示例#2
0
        public static NzbDrone.Core.Music.Artist ToModel(this ArtistResource resource)
        {
            if (resource == null)
            {
                return(null);
            }

            return(new NzbDrone.Core.Music.Artist
            {
                Id = resource.Id,

                Metadata = new NzbDrone.Core.Music.ArtistMetadata
                {
                    ForeignArtistId = resource.ForeignArtistId,
                    Name = resource.ArtistName,
                    Status = resource.Status,
                    Overview = resource.Overview,
                    Links = resource.Links,
                    Images = resource.Images,
                    Genres = resource.Genres,
                    Ratings = resource.Ratings,
                    Type = resource.ArtistType
                },

                //AlternateTitles
                SortName = resource.SortName,
                Path = resource.Path,
                QualityProfileId = resource.QualityProfileId,
                MetadataProfileId = resource.MetadataProfileId,


                AlbumFolder = resource.AlbumFolder,
                Monitored = resource.Monitored,

                LastInfoSync = resource.LastInfoSync,
                CleanName = resource.CleanName,
                RootFolderPath = resource.RootFolderPath,

                Tags = resource.Tags,
                Added = resource.Added,
                AddOptions = resource.AddOptions,
            });
        }