Added IsFolder
This commit is contained in:
parent
0ec2ab5b7b
commit
bbc88549ab
|
@ -131,6 +131,14 @@ namespace MediaBrowser.Model.Entities
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual bool IsFolder
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if the item is considered new based on user settings
|
/// Determines if the item is considered new based on user settings
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -6,6 +6,14 @@ namespace MediaBrowser.Model.Entities
|
||||||
{
|
{
|
||||||
public class Folder : BaseItem
|
public class Folder : BaseItem
|
||||||
{
|
{
|
||||||
|
public override bool IsFolder
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool IsRoot { get; set; }
|
public bool IsRoot { get; set; }
|
||||||
|
|
||||||
public BaseItem[] Children { get; set; }
|
public BaseItem[] Children { get; set; }
|
||||||
|
@ -139,7 +147,7 @@ namespace MediaBrowser.Model.Entities
|
||||||
|
|
||||||
private static IEnumerable<BaseItem> GetRecentlyAddedItems(IEnumerable<BaseItem> itemSet, User user)
|
private static IEnumerable<BaseItem> GetRecentlyAddedItems(IEnumerable<BaseItem> itemSet, User user)
|
||||||
{
|
{
|
||||||
return itemSet.Where(i => !(i is Folder) && i.IsRecentlyAdded(user));
|
return itemSet.Where(i => !(i.IsFolder) && i.IsRecentlyAdded(user));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IEnumerable<BaseItem> GetRecentlyAddedUnplayedItems(IEnumerable<BaseItem> itemSet, User user)
|
private static IEnumerable<BaseItem> GetRecentlyAddedUnplayedItems(IEnumerable<BaseItem> itemSet, User user)
|
||||||
|
@ -156,7 +164,7 @@ namespace MediaBrowser.Model.Entities
|
||||||
{
|
{
|
||||||
return itemSet.Where(i =>
|
return itemSet.Where(i =>
|
||||||
{
|
{
|
||||||
if (i is Folder)
|
if (i.IsFolder)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -169,7 +177,7 @@ namespace MediaBrowser.Model.Entities
|
||||||
|
|
||||||
private static decimal GetPlayedPercentage(IEnumerable<BaseItem> itemSet, User user)
|
private static decimal GetPlayedPercentage(IEnumerable<BaseItem> itemSet, User user)
|
||||||
{
|
{
|
||||||
itemSet = itemSet.Where(i => !(i is Folder));
|
itemSet = itemSet.Where(i => !(i.IsFolder));
|
||||||
|
|
||||||
if (!itemSet.Any())
|
if (!itemSet.Any())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user