Merge pull request #1701 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-05-02 13:13:04 -04:00
commit 4654ee606f
4 changed files with 36 additions and 4 deletions

View File

@ -1578,8 +1578,36 @@ namespace MediaBrowser.Controller.Entities
return !IsPlayed(user); 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) public override void FillUserDataDtoValues(UserItemDataDto dto, UserItemData userData, User user)
{ {
if (!SupportsUserDataFromChildren)
{
return;
}
var recursiveItemCount = 0; var recursiveItemCount = 0;
var unplayed = 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); } get { return LocationType == LocationType.Virtual && GetEpisodes().All(i => i.IsMissingEpisode); }
} }
private bool GetIsUnaired()
{
return GetEpisodes().All(i => i.IsUnaired);
}
[IgnoreDataMember] [IgnoreDataMember]
public bool IsUnaired public bool IsUnaired
{ {
get { return GetEpisodes().All(i => i.IsUnaired); } get { return GetIsUnaired(); }
} }
[IgnoreDataMember] [IgnoreDataMember]

View File

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

View File

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