Lidarr/src/NzbDrone.Core/Music/Artist.cs

71 lines
2.5 KiB
C#
Raw Normal View History

2017-09-04 02:20:56 +00:00
using Marr.Data;
2017-04-20 23:19:47 +00:00
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Datastore;
2017-09-04 02:20:56 +00:00
using NzbDrone.Core.Profiles.Qualities;
using NzbDrone.Core.Profiles.Languages;
using NzbDrone.Core.Profiles.Metadata;
2017-04-20 23:19:47 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NzbDrone.Core.Music
{
public class Artist : ModelBase
{
public Artist()
{
Tags = new HashSet<int>();
Metadata = new ArtistMetadata();
2017-04-20 23:19:47 +00:00
}
public int ArtistMetadataId { get; set; }
public LazyLoaded<ArtistMetadata> Metadata { get; set; }
public string CleanName { get; set; }
public string SortName { get; set; }
2017-04-20 23:19:47 +00:00
public bool Monitored { get; set; }
public bool AlbumFolder { get; set; }
public DateTime? LastInfoSync { get; set; }
public string Path { get; set; }
public string RootFolderPath { get; set; }
public DateTime Added { get; set; }
public int ProfileId { get; set; }
2017-04-20 23:19:47 +00:00
public LazyLoaded<Profile> Profile { get; set; }
public int LanguageProfileId { get; set; }
2017-09-04 02:20:56 +00:00
public LazyLoaded<LanguageProfile> LanguageProfile { get; set; }
public int MetadataProfileId { get; set; }
public LazyLoaded<MetadataProfile> MetadataProfile { get; set; }
public LazyLoaded<List<Album>> Albums { get; set; }
2017-04-20 23:19:47 +00:00
public HashSet<int> Tags { get; set; }
public AddArtistOptions AddOptions { get; set; }
2017-04-20 23:19:47 +00:00
public override string ToString()
{
return string.Format("[{0}][{1}]", Metadata.Value.ForeignArtistId, Metadata.Value.Name.NullSafe());
2017-04-20 23:19:47 +00:00
}
public void ApplyChanges(Artist otherArtist)
{
Path = otherArtist.Path;
ProfileId = otherArtist.ProfileId;
Profile = otherArtist.Profile;
2017-09-04 02:20:56 +00:00
LanguageProfileId = otherArtist.LanguageProfileId;
MetadataProfileId = otherArtist.MetadataProfileId;
Albums = otherArtist.Albums;
Tags = otherArtist.Tags;
AddOptions = otherArtist.AddOptions;
RootFolderPath = otherArtist.RootFolderPath;
Monitored = otherArtist.Monitored;
AlbumFolder = otherArtist.AlbumFolder;
2017-04-20 23:19:47 +00:00
}
//compatibility properties
public string Name { get { return Metadata.Value.Name; } set { Metadata.Value.Name = value; } }
public string ForeignArtistId { get { return Metadata.Value.ForeignArtistId; } set { Metadata.Value.ForeignArtistId = value; } }
2017-04-20 23:19:47 +00:00
}
}