Merge branch 'beta' of https://github.com/MediaBrowser/Emby into beta

This commit is contained in:
Luke Pulverenti 2016-05-02 13:16:15 -04:00
commit ff649e619c
4 changed files with 36 additions and 4 deletions

View File

@ -1578,8 +1578,36 @@ namespace MediaBrowser.Controller.Entities
return !IsPlayed(user);
}
[IgnoreDataMember]
public virtual bool SupportsUserDataFromChildren
{
get
{
// These are just far too slow.
if (this is ICollectionFolder)
{
return false;
}
if (this is UserView)
{
return false;
}
if (this is UserRootFolder)
{
return false;
}
return true;
}
}
public override void FillUserDataDtoValues(UserItemDataDto dto, UserItemData userData, User user)
{
if (!SupportsUserDataFromChildren)
{
return;
}
var recursiveItemCount = 0;
var unplayed = 0;

View File

@ -125,10 +125,15 @@ namespace MediaBrowser.Controller.Entities.TV
get { return LocationType == LocationType.Virtual && GetEpisodes().All(i => i.IsMissingEpisode); }
}
private bool GetIsUnaired()
{
return GetEpisodes().All(i => i.IsUnaired);
}
[IgnoreDataMember]
public bool IsUnaired
{
get { return GetEpisodes().All(i => i.IsUnaired); }
get { return GetIsUnaired(); }
}
[IgnoreDataMember]

View File

@ -499,8 +499,7 @@ namespace MediaBrowser.Server.Implementations.Dto
{
dto.ChildCount = GetChildCount(folder, user);
// These are just far too slow.
if (!(folder is UserRootFolder) && !(folder is UserView) && !(folder is ICollectionFolder))
if (!folder.SupportsUserDataFromChildren)
{
SetSpecialCounts(folder, user, dto, fields, syncProgress);
}

View File

@ -82,7 +82,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
private IDbCommand _updateInheritedRatingCommand;
private IDbCommand _updateInheritedTagsCommand;
public const int LatestSchemaVersion = 68;
public const int LatestSchemaVersion = 69;
/// <summary>
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.