diff options
Diffstat (limited to 'MediaBrowser.Controller/Entities/Audio')
| -rw-r--r-- | MediaBrowser.Controller/Entities/Audio/Audio.cs | 38 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs | 47 |
2 files changed, 8 insertions, 77 deletions
diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.cs index 100633d7f..623329ca6 100644 --- a/MediaBrowser.Controller/Entities/Audio/Audio.cs +++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs @@ -52,34 +52,6 @@ namespace MediaBrowser.Controller.Entities.Audio /// <value><c>true</c> if this instance has embedded image; otherwise, <c>false</c>.</value> public bool HasEmbeddedImage { get; set; } - /// <summary> - /// Override this to true if class should be grouped under a container in indicies - /// The container class should be defined via IndexContainer - /// </summary> - /// <value><c>true</c> if [group in index]; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public override bool GroupInIndex - { - get - { - return true; - } - } - - /// <summary> - /// Override this to return the folder that should be used to construct a container - /// for this item in an index. GroupInIndex should be true as well. - /// </summary> - /// <value>The index container.</value> - [IgnoreDataMember] - public override Folder IndexContainer - { - get - { - return LatestItemsIndexContainer ?? new MusicAlbum { Name = "Unknown Album" }; - } - } - [IgnoreDataMember] protected override bool SupportsOwnedItems { @@ -94,7 +66,7 @@ namespace MediaBrowser.Controller.Entities.Audio { get { - return Parents.OfType<MusicAlbum>().FirstOrDefault(); + return AlbumEntity; } } @@ -148,6 +120,12 @@ namespace MediaBrowser.Controller.Entities.Audio /// <value>The album.</value> public string Album { get; set; } + [IgnoreDataMember] + public MusicAlbum AlbumEntity + { + get { return FindParent<MusicAlbum>(); } + } + /// <summary> /// Gets the type of the media. /// </summary> @@ -177,7 +155,7 @@ namespace MediaBrowser.Controller.Entities.Audio /// <returns>System.String.</returns> protected override string CreateUserDataKey() { - var parent = FindParent<MusicAlbum>(); + var parent = AlbumEntity; if (parent != null) { diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs index dc3f13b01..c060f53a6 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs @@ -2,7 +2,6 @@ using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Users; -using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; @@ -14,11 +13,8 @@ namespace MediaBrowser.Controller.Entities.Audio /// </summary> public class MusicAlbum : Folder, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasLookupInfo<AlbumInfo> { - public List<Guid> SoundtrackIds { get; set; } - public MusicAlbum() { - SoundtrackIds = new List<Guid>(); Artists = new List<string>(); AlbumArtists = new List<string>(); } @@ -77,49 +73,6 @@ namespace MediaBrowser.Controller.Entities.Audio return Tracks; } - /// <summary> - /// Songs will group into us so don't also include us in the index - /// </summary> - /// <value><c>true</c> if [include in index]; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public override bool IncludeInIndex - { - get - { - return false; - } - } - - /// <summary> - /// Override this to true if class should be grouped under a container in indicies - /// The container class should be defined via IndexContainer - /// </summary> - /// <value><c>true</c> if [group in index]; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public override bool GroupInIndex - { - get - { - return true; - } - } - - /// <summary> - /// The unknwon artist - /// </summary> - private static readonly MusicArtist UnknwonArtist = new MusicArtist { Name = "<Unknown>" }; - - /// <summary> - /// Override this to return the folder that should be used to construct a container - /// for this item in an index. GroupInIndex should be true as well. - /// </summary> - /// <value>The index container.</value> - [IgnoreDataMember] - public override Folder IndexContainer - { - get { return Parent as MusicArtist ?? UnknwonArtist; } - } - public List<string> Artists { get; set; } /// <summary> |
