mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-04 06:48:35 +01:00
new Artist entity
This commit is contained in:
@@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
/// <returns>System.String.</returns>
|
||||
public override string GetUserDataKey()
|
||||
{
|
||||
return Name;
|
||||
return "Artist-" + Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,5 +113,15 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
return (ProductionYear != null ? ProductionYear.Value.ToString("000-") : "")
|
||||
+ (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ") : "") + Name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified name has artist.
|
||||
/// </summary>
|
||||
/// <param name="name">The name.</param>
|
||||
/// <returns><c>true</c> if the specified name has artist; otherwise, <c>false</c>.</returns>
|
||||
public bool HasArtist(string name)
|
||||
{
|
||||
return Artists.Contains(name, StringComparer.OrdinalIgnoreCase) || string.Equals(AlbumArtist, name, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
/// <summary>
|
||||
/// The unknwon artist
|
||||
/// </summary>
|
||||
private static readonly MusicArtist UnknwonArtist = new MusicArtist {Name = "<Unknown>"};
|
||||
private static readonly MusicArtist UnknwonArtist = new MusicArtist { Name = "<Unknown>" };
|
||||
|
||||
/// <summary>
|
||||
/// Override this to return the folder that should be used to construct a container
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities.Audio
|
||||
{
|
||||
/// <summary>
|
||||
@@ -8,12 +6,6 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
/// </summary>
|
||||
public class MusicArtist : Folder
|
||||
{
|
||||
public Dictionary<string, string> AlbumCovers { get; set; }
|
||||
|
||||
public override void ClearMetaValues()
|
||||
{
|
||||
AlbumCovers = null;
|
||||
base.ClearMetaValues();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,14 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// </summary>
|
||||
public abstract class BaseItem : IHasProviderIds
|
||||
{
|
||||
protected BaseItem()
|
||||
{
|
||||
Genres = new List<string>();
|
||||
TrailerUrls = new List<string>();
|
||||
Studios = new List<string>();
|
||||
People = new List<PersonInfo>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The trailer folder name
|
||||
/// </summary>
|
||||
@@ -925,16 +933,10 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <summary>
|
||||
/// Determines if the item is considered new based on user settings
|
||||
/// </summary>
|
||||
/// <param name="user">The user.</param>
|
||||
/// <returns><c>true</c> if [is recently added] [the specified user]; otherwise, <c>false</c>.</returns>
|
||||
/// <exception cref="System.ArgumentNullException"></exception>
|
||||
public bool IsRecentlyAdded(User user)
|
||||
public bool IsRecentlyAdded()
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
throw new ArgumentNullException();
|
||||
}
|
||||
|
||||
return (DateTime.UtcNow - DateCreated).TotalDays < ConfigurationManager.Configuration.RecentItemDays;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <returns>System.String.</returns>
|
||||
public override string GetUserDataKey()
|
||||
{
|
||||
return Name;
|
||||
return "Genre-" + Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <returns>System.String.</returns>
|
||||
public override string GetUserDataKey()
|
||||
{
|
||||
return Name;
|
||||
return "Person-" + Name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <returns>System.String.</returns>
|
||||
public override string GetUserDataKey()
|
||||
{
|
||||
return Name;
|
||||
return "Studio-" + Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <returns>System.String.</returns>
|
||||
public override string GetUserDataKey()
|
||||
{
|
||||
return Name;
|
||||
return "Year-" + Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user