aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/LibraryManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Library/LibraryManager.cs19
1 files changed, 14 insertions, 5 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
index 1bc3f1094..2ba16ab03 100644
--- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
@@ -1288,15 +1288,15 @@ namespace MediaBrowser.Server.Implementations.Library
/// <returns>Task.</returns>
public async Task UpdateItem(BaseItem item, ItemUpdateType updateReason, CancellationToken cancellationToken)
{
- await ItemRepository.SaveItem(item, cancellationToken).ConfigureAwait(false);
-
- UpdateItemInLibraryCache(item);
-
if (item.LocationType == LocationType.FileSystem)
{
await SaveMetadata(item, updateReason).ConfigureAwait(false);
}
+ await ItemRepository.SaveItem(item, cancellationToken).ConfigureAwait(false);
+
+ UpdateItemInLibraryCache(item);
+
if (ItemUpdated != null)
{
try
@@ -1346,7 +1346,16 @@ namespace MediaBrowser.Server.Implementations.Library
/// <returns>BaseItem.</returns>
public BaseItem RetrieveItem(Guid id)
{
- return ItemRepository.RetrieveItem(id);
+ var item = ItemRepository.RetrieveItem(id);
+
+ var folder = item as Folder;
+
+ if (folder != null)
+ {
+ folder.LoadSavedChildren();
+ }
+
+ return item;
}
private readonly ConcurrentDictionary<string, SemaphoreSlim> _fileLocks = new ConcurrentDictionary<string, SemaphoreSlim>();