aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/UserRootFolder.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-08-15 20:22:59 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-08-15 20:22:59 -0400
commitec111eebd3ac70bed57e7645fd562960c7c72030 (patch)
tree10fe574e9136eb6b78e461f62ea791e97121d0bb /MediaBrowser.Controller/Entities/UserRootFolder.cs
parent02a4b90f65bdee74e65cd0549e4ad691c8e1eea8 (diff)
fix folder caching
Diffstat (limited to 'MediaBrowser.Controller/Entities/UserRootFolder.cs')
-rw-r--r--MediaBrowser.Controller/Entities/UserRootFolder.cs15
1 files changed, 12 insertions, 3 deletions
diff --git a/MediaBrowser.Controller/Entities/UserRootFolder.cs b/MediaBrowser.Controller/Entities/UserRootFolder.cs
index d043cba47..bd25d3a6a 100644
--- a/MediaBrowser.Controller/Entities/UserRootFolder.cs
+++ b/MediaBrowser.Controller/Entities/UserRootFolder.cs
@@ -33,7 +33,7 @@ namespace MediaBrowser.Controller.Entities
}
}
- private void ResetCachedChildren()
+ private void ClearCache()
{
lock (_childIdsLock)
{
@@ -94,7 +94,7 @@ namespace MediaBrowser.Controller.Entities
public override bool BeforeMetadataRefresh()
{
- ResetCachedChildren();
+ ClearCache();
var hasChanges = base.BeforeMetadataRefresh();
@@ -107,13 +107,22 @@ namespace MediaBrowser.Controller.Entities
return hasChanges;
}
+ protected override IEnumerable<BaseItem> GetNonCachedChildren(IDirectoryService directoryService)
+ {
+ ClearCache();
+
+ return base.GetNonCachedChildren(directoryService);
+ }
+
protected override async Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)
{
- ResetCachedChildren();
+ ClearCache();
await base.ValidateChildrenInternal(progress, cancellationToken, recursive, refreshChildMetadata, refreshOptions, directoryService)
.ConfigureAwait(false);
+ ClearCache();
+
// Not the best way to handle this, but it solves an issue
// CollectionFolders aren't always getting saved after changes
// This means that grabbing the item by Id may end up returning the old one