aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Entities')
-rw-r--r--MediaBrowser.Controller/Entities/Audio/Audio.cs38
-rw-r--r--MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs47
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs32
-rw-r--r--MediaBrowser.Controller/Entities/TV/Episode.cs23
-rw-r--r--MediaBrowser.Controller/Entities/TV/Season.cs44
-rw-r--r--MediaBrowser.Controller/Entities/TV/Series.cs13
6 files changed, 9 insertions, 188 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>
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index 3313f45fd..8b6cbdc93 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -906,38 +906,6 @@ namespace MediaBrowser.Controller.Entities
/// <value>The provider ids.</value>
public Dictionary<string, string> ProviderIds { get; set; }
- /// <summary>
- /// Override this to false if class should be ignored for indexing purposes
- /// </summary>
- /// <value><c>true</c> if [include in index]; otherwise, <c>false</c>.</value>
- [IgnoreDataMember]
- public virtual bool IncludeInIndex
- {
- get { return true; }
- }
-
- /// <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 virtual bool GroupInIndex
- {
- get { return false; }
- }
-
- /// <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 virtual Folder IndexContainer
- {
- get { return null; }
- }
-
[IgnoreDataMember]
public virtual Folder LatestItemsIndexContainer
{
diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs
index c8408365d..8f5b8f6cf 100644
--- a/MediaBrowser.Controller/Entities/TV/Episode.cs
+++ b/MediaBrowser.Controller/Entities/TV/Episode.cs
@@ -45,16 +45,6 @@ namespace MediaBrowser.Controller.Entities.TV
/// <value>The index number.</value>
public int? IndexNumberEnd { get; set; }
- /// <summary>
- /// We want to group into series not show individually in an index
- /// </summary>
- /// <value><c>true</c> if [group in index]; otherwise, <c>false</c>.</value>
- [IgnoreDataMember]
- public override bool GroupInIndex
- {
- get { return true; }
- }
-
[IgnoreDataMember]
protected override bool SupportsOwnedItems
{
@@ -91,19 +81,6 @@ namespace MediaBrowser.Controller.Entities.TV
}
}
- /// <summary>
- /// We roll up into series
- /// </summary>
- /// <value>The index container.</value>
- [IgnoreDataMember]
- public override Folder IndexContainer
- {
- get
- {
- return Season;
- }
- }
-
[IgnoreDataMember]
public override Folder LatestItemsIndexContainer
{
diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs
index a99b8c659..cfd6b46e0 100644
--- a/MediaBrowser.Controller/Entities/TV/Season.cs
+++ b/MediaBrowser.Controller/Entities/TV/Season.cs
@@ -1,5 +1,4 @@
-using MediaBrowser.Controller.Localization;
-using MediaBrowser.Controller.Providers;
+using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Users;
@@ -15,20 +14,6 @@ namespace MediaBrowser.Controller.Entities.TV
/// </summary>
public class Season : Folder, IHasSeries, IHasLookupInfo<SeasonInfo>
{
-
- /// <summary>
- /// Seasons are just containers
- /// </summary>
- /// <value><c>true</c> if [include in index]; otherwise, <c>false</c>.</value>
- [IgnoreDataMember]
- public override bool IncludeInIndex
- {
- get
- {
- return false;
- }
- }
-
[IgnoreDataMember]
public override bool SupportsAddingToPlaylist
{
@@ -50,33 +35,6 @@ namespace MediaBrowser.Controller.Entities.TV
get { return Series ?? Parent; }
}
- /// <summary>
- /// We want to group into our Series
- /// </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 Series;
- }
- }
-
// Genre, Rating and Stuido will all be the same
protected override IEnumerable<string> GetIndexByOptions()
{
diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs
index 4696afeb6..2663d19e8 100644
--- a/MediaBrowser.Controller/Entities/TV/Series.cs
+++ b/MediaBrowser.Controller/Entities/TV/Series.cs
@@ -95,19 +95,6 @@ namespace MediaBrowser.Controller.Entities.TV
}
/// <summary>
- /// Series aren't included directly in indices - Their Episodes will roll up to them
- /// </summary>
- /// <value><c>true</c> if [include in index]; otherwise, <c>false</c>.</value>
- [IgnoreDataMember]
- public override bool IncludeInIndex
- {
- get
- {
- return false;
- }
- }
-
- /// <summary>
/// Gets the user data key.
/// </summary>
/// <returns>System.String.</returns>