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;
|
2017-11-26 03:51:37 +00:00
|
|
|
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>();
|
2018-12-15 00:02:43 +00:00
|
|
|
Metadata = new ArtistMetadata();
|
2017-04-20 23:19:47 +00:00
|
|
|
}
|
|
|
|
|
2018-12-15 00:02:43 +00:00
|
|
|
public int ArtistMetadataId { get; set; }
|
|
|
|
public LazyLoaded<ArtistMetadata> Metadata { get; set; }
|
2017-06-13 02:02:17 +00:00
|
|
|
public string CleanName { get; set; }
|
2017-08-14 02:58:42 +00:00
|
|
|
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; }
|
2018-12-15 00:02:43 +00:00
|
|
|
public int ProfileId { get; set; }
|
2017-04-20 23:19:47 +00:00
|
|
|
public LazyLoaded<Profile> Profile { get; set; }
|
2018-12-15 00:02:43 +00:00
|
|
|
public int LanguageProfileId { get; set; }
|
2017-09-04 02:20:56 +00:00
|
|
|
public LazyLoaded<LanguageProfile> LanguageProfile { get; set; }
|
2018-12-15 00:02:43 +00:00
|
|
|
public int MetadataProfileId { get; set; }
|
2017-11-26 03:51:37 +00:00
|
|
|
public LazyLoaded<MetadataProfile> MetadataProfile { get; set; }
|
2018-12-15 00:02:43 +00:00
|
|
|
public LazyLoaded<List<Album>> Albums { get; set; }
|
2017-04-20 23:19:47 +00:00
|
|
|
public HashSet<int> Tags { get; set; }
|
2017-06-25 13:17:49 +00:00
|
|
|
public AddArtistOptions AddOptions { get; set; }
|
2017-04-28 22:05:35 +00:00
|
|
|
|
2017-04-20 23:19:47 +00:00
|
|
|
public override string ToString()
|
|
|
|
{
|
2018-12-15 00:02:43 +00:00
|
|
|
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)
|
|
|
|
{
|
2017-05-02 02:07:11 +00:00
|
|
|
|
|
|
|
Path = otherArtist.Path;
|
2018-12-15 00:02:43 +00:00
|
|
|
ProfileId = otherArtist.ProfileId;
|
2017-05-02 02:07:11 +00:00
|
|
|
Profile = otherArtist.Profile;
|
2017-09-04 02:20:56 +00:00
|
|
|
LanguageProfileId = otherArtist.LanguageProfileId;
|
2017-11-26 03:51:37 +00:00
|
|
|
MetadataProfileId = otherArtist.MetadataProfileId;
|
2017-07-08 02:06:21 +00:00
|
|
|
|
2017-05-02 02:07:11 +00:00
|
|
|
Albums = otherArtist.Albums;
|
|
|
|
Tags = otherArtist.Tags;
|
|
|
|
AddOptions = otherArtist.AddOptions;
|
2017-07-08 02:06:21 +00:00
|
|
|
RootFolderPath = otherArtist.RootFolderPath;
|
|
|
|
Monitored = otherArtist.Monitored;
|
|
|
|
AlbumFolder = otherArtist.AlbumFolder;
|
2017-05-02 02:07:11 +00:00
|
|
|
|
2017-04-20 23:19:47 +00:00
|
|
|
}
|
2018-12-15 00:02:43 +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
|
|
|
}
|
|
|
|
}
|