Added IsFolder

pull/702/head
LukePulverenti Luke Pulverenti luke pulverenti 12 years ago
parent 0ec2ab5b7b
commit bbc88549ab

@ -131,6 +131,14 @@ namespace MediaBrowser.Model.Entities
return null;
}
public virtual bool IsFolder
{
get
{
return false;
}
}
/// <summary>
/// Determines if the item is considered new based on user settings
/// </summary>

@ -6,6 +6,14 @@ namespace MediaBrowser.Model.Entities
{
public class Folder : BaseItem
{
public override bool IsFolder
{
get
{
return true;
}
}
public bool IsRoot { 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)
{
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)
@ -156,7 +164,7 @@ namespace MediaBrowser.Model.Entities
{
return itemSet.Where(i =>
{
if (i is Folder)
if (i.IsFolder)
{
return false;
}
@ -169,7 +177,7 @@ namespace MediaBrowser.Model.Entities
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())
{

Loading…
Cancel
Save