aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/Movies/BoxSet.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Entities/Movies/BoxSet.cs')
-rw-r--r--MediaBrowser.Controller/Entities/Movies/BoxSet.cs74
1 files changed, 12 insertions, 62 deletions
diff --git a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs
index 071ed405f..900e8a664 100644
--- a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs
+++ b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs
@@ -1,5 +1,4 @@
-using MediaBrowser.Controller.Entities.TV;
-using MediaBrowser.Controller.Providers;
+using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying;
@@ -8,7 +7,6 @@ using System;
using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Model.Serialization;
-using MediaBrowser.Controller.Entities.Audio;
namespace MediaBrowser.Controller.Entities.Movies
{
@@ -21,9 +19,9 @@ namespace MediaBrowser.Controller.Entities.Movies
public BoxSet()
{
- RemoteTrailers = new List<MediaUrl>();
- LocalTrailerIds = new List<Guid>();
- RemoteTrailerIds = new List<Guid>();
+ RemoteTrailers = EmptyMediaUrlArray;
+ LocalTrailerIds = EmptyGuidArray;
+ RemoteTrailerIds = EmptyGuidArray;
DisplayOrder = ItemSortBy.PremiereDate;
Shares = new List<Share>();
@@ -47,14 +45,14 @@ namespace MediaBrowser.Controller.Entities.Movies
}
}
- public List<Guid> LocalTrailerIds { get; set; }
- public List<Guid> RemoteTrailerIds { get; set; }
+ public Guid[] LocalTrailerIds { get; set; }
+ public Guid[] RemoteTrailerIds { get; set; }
/// <summary>
/// Gets or sets the remote trailers.
/// </summary>
/// <value>The remote trailers.</value>
- public List<MediaUrl> RemoteTrailers { get; set; }
+ public MediaUrl[] RemoteTrailers { get; set; }
/// <summary>
/// Gets or sets the display order.
@@ -82,20 +80,11 @@ namespace MediaBrowser.Controller.Entities.Movies
protected override IEnumerable<BaseItem> GetNonCachedChildren(IDirectoryService directoryService)
{
- if (IsLegacyBoxSet)
- {
- return base.GetNonCachedChildren(directoryService);
- }
return new List<BaseItem>();
}
protected override List<BaseItem> LoadChildren()
{
- if (IsLegacyBoxSet)
- {
- return base.LoadChildren();
- }
-
// Save a trip to the database
return new List<BaseItem>();
}
@@ -109,34 +98,6 @@ namespace MediaBrowser.Controller.Entities.Movies
}
}
- [IgnoreDataMember]
- protected override bool SupportsShortcutChildren
- {
- get
- {
- if (IsLegacyBoxSet)
- {
- return true;
- }
-
- return false;
- }
- }
-
- [IgnoreDataMember]
- private bool IsLegacyBoxSet
- {
- get
- {
- if (string.IsNullOrWhiteSpace(Path))
- {
- return false;
- }
-
- return !FileSystem.ContainsSubPath(ConfigurationManager.ApplicationPaths.DataPath, Path);
- }
- }
-
public override bool IsAuthorizedToDelete(User user)
{
return true;
@@ -148,17 +109,6 @@ namespace MediaBrowser.Controller.Entities.Movies
}
/// <summary>
- /// Gets the trailer ids.
- /// </summary>
- /// <returns>List&lt;Guid&gt;.</returns>
- public List<Guid> GetTrailerIds()
- {
- var list = LocalTrailerIds.ToList();
- list.AddRange(RemoteTrailerIds);
- return list;
- }
-
- /// <summary>
/// Updates the official rating based on content and returns true or false indicating if it changed.
/// </summary>
/// <returns></returns>
@@ -181,24 +131,24 @@ namespace MediaBrowser.Controller.Entities.Movies
StringComparison.OrdinalIgnoreCase);
}
- public override IEnumerable<BaseItem> GetChildren(User user, bool includeLinkedChildren)
+ public override List<BaseItem> GetChildren(User user, bool includeLinkedChildren)
{
var children = base.GetChildren(user, includeLinkedChildren);
if (string.Equals(DisplayOrder, ItemSortBy.SortName, StringComparison.OrdinalIgnoreCase))
{
// Sort by name
- return LibraryManager.Sort(children, user, new[] { ItemSortBy.SortName }, SortOrder.Ascending);
+ return LibraryManager.Sort(children, user, new[] { ItemSortBy.SortName }, SortOrder.Ascending).ToList();
}
if (string.Equals(DisplayOrder, ItemSortBy.PremiereDate, StringComparison.OrdinalIgnoreCase))
{
// Sort by release date
- return LibraryManager.Sort(children, user, new[] { ItemSortBy.ProductionYear, ItemSortBy.PremiereDate, ItemSortBy.SortName }, SortOrder.Ascending);
+ return LibraryManager.Sort(children, user, new[] { ItemSortBy.ProductionYear, ItemSortBy.PremiereDate, ItemSortBy.SortName }, SortOrder.Ascending).ToList();
}
// Default sorting
- return LibraryManager.Sort(children, user, new[] { ItemSortBy.ProductionYear, ItemSortBy.PremiereDate, ItemSortBy.SortName }, SortOrder.Ascending);
+ return LibraryManager.Sort(children, user, new[] { ItemSortBy.ProductionYear, ItemSortBy.PremiereDate, ItemSortBy.SortName }, SortOrder.Ascending).ToList();
}
public BoxSetInfo GetLookupInfo()
@@ -218,7 +168,7 @@ namespace MediaBrowser.Controller.Entities.Movies
if (base.IsVisible(user))
{
- return base.GetChildren(user, true).Any();
+ return base.GetChildren(user, true).Count > 0;
}
return false;