aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/Folder.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Entities/Folder.cs')
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs88
1 files changed, 36 insertions, 52 deletions
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index f1d8def4b..1e466ec08 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -22,13 +22,18 @@ namespace MediaBrowser.Controller.Entities
/// <summary>
/// Class Folder
/// </summary>
- public class Folder : BaseItem, IHasThemeMedia
+ public class Folder : BaseItem
{
public static IUserManager UserManager { get; set; }
public static IUserViewManager UserViewManager { get; set; }
- public List<Guid> ThemeSongIds { get; set; }
- public List<Guid> ThemeVideoIds { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is root.
+ /// </summary>
+ /// <value><c>true</c> if this instance is root; otherwise, <c>false</c>.</value>
+ public bool IsRoot { get; set; }
+
+ public virtual List<LinkedChild> LinkedChildren { get; set; }
[IgnoreDataMember]
public DateTime? DateLastMediaAdded { get; set; }
@@ -36,9 +41,12 @@ namespace MediaBrowser.Controller.Entities
public Folder()
{
LinkedChildren = new List<LinkedChild>();
+ }
- ThemeSongIds = new List<Guid>();
- ThemeVideoIds = new List<Guid>();
+ [IgnoreDataMember]
+ public override bool SupportsThemeMedia
+ {
+ get { return true; }
}
[IgnoreDataMember]
@@ -47,6 +55,21 @@ namespace MediaBrowser.Controller.Entities
get { return false; }
}
+ [IgnoreDataMember]
+ public virtual bool IsPhysicalRoot
+ {
+ get { return false; }
+ }
+
+ [IgnoreDataMember]
+ public override bool SupportsPlayedStatus
+ {
+ get
+ {
+ return true;
+ }
+ }
+
/// <summary>
/// Gets a value indicating whether this instance is folder.
/// </summary>
@@ -117,19 +140,6 @@ namespace MediaBrowser.Controller.Entities
return true;
}
- /// <summary>
- /// Gets or sets a value indicating whether this instance is physical root.
- /// </summary>
- /// <value><c>true</c> if this instance is physical root; otherwise, <c>false</c>.</value>
- public bool IsPhysicalRoot { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether this instance is root.
- /// </summary>
- /// <value><c>true</c> if this instance is root; otherwise, <c>false</c>.</value>
- public bool IsRoot { get; set; }
-
- public virtual List<LinkedChild> LinkedChildren { get; set; }
-
[IgnoreDataMember]
protected virtual bool SupportsShortcutChildren
{
@@ -178,8 +188,6 @@ namespace MediaBrowser.Controller.Entities
item.SetParent(null);
}
- #region Indexing
-
/// <summary>
/// Returns the valid set of index by options for this folder type.
/// Override or extend to modify.
@@ -207,8 +215,6 @@ namespace MediaBrowser.Controller.Entities
get { return GetIndexByOptions(); }
}
- #endregion
-
/// <summary>
/// Gets the actual children.
/// </summary>
@@ -801,18 +807,6 @@ namespace MediaBrowser.Controller.Entities
return true;
}
- if (query.HasThemeSong.HasValue)
- {
- Logger.Debug("Query requires post-filtering due to HasThemeSong");
- return true;
- }
-
- if (query.HasThemeVideo.HasValue)
- {
- Logger.Debug("Query requires post-filtering due to HasThemeVideo");
- return true;
- }
-
// Filter by VideoType
if (query.VideoTypes.Length > 0)
{
@@ -1149,29 +1143,19 @@ namespace MediaBrowser.Controller.Entities
return LinkedChildren
.Select(i =>
{
- var requiresPostFilter = true;
-
- if (!string.IsNullOrWhiteSpace(i.Path))
- {
- requiresPostFilter = false;
-
- if (!locations.Any(l => FileSystem.ContainsSubPath(l, i.Path)))
- {
- return null;
- }
- }
-
var child = GetLinkedChild(i);
- if (requiresPostFilter && child != null)
+ if (child != null)
{
- if (string.IsNullOrWhiteSpace(child.Path))
+ var childLocationType = child.LocationType;
+ if (childLocationType == LocationType.Remote || childLocationType == LocationType.Virtual)
{
- Logger.Debug("Found LinkedChild with null path: {0}", child.Name);
- return child;
+ if (!child.IsVisibleStandalone(user))
+ {
+ return null;
+ }
}
-
- if (!locations.Any(l => FileSystem.ContainsSubPath(l, child.Path)))
+ else if (childLocationType == LocationType.FileSystem && !locations.Any(l => FileSystem.ContainsSubPath(l, child.Path)))
{
return null;
}