fixed image providers from running everytime against collection folders

pull/702/head
Luke Pulverenti 12 years ago
parent 5ecc276cb7
commit 99959f5d10

@ -905,7 +905,6 @@ namespace MediaBrowser.Controller.Entities
if (changed || forceSave || themeSongsChanged || themeVideosChanged || localTrailersChanged) if (changed || forceSave || themeSongsChanged || themeVideosChanged || localTrailersChanged)
{ {
cancellationToken.ThrowIfCancellationRequested(); cancellationToken.ThrowIfCancellationRequested();
await LibraryManager.UpdateItem(this, cancellationToken).ConfigureAwait(false); await LibraryManager.UpdateItem(this, cancellationToken).ConfigureAwait(false);
} }
@ -1506,7 +1505,7 @@ namespace MediaBrowser.Controller.Entities
} }
// Refresh metadata // Refresh metadata
return RefreshMetadata(CancellationToken.None); return RefreshMetadata(CancellationToken.None, forceSave: true);
} }
} }
} }

@ -15,7 +15,7 @@ namespace MediaBrowser.Controller.Entities
/// Specialized Folder class that points to a subset of the physical folders in the system. /// Specialized Folder class that points to a subset of the physical folders in the system.
/// It is created from the user-specific folders within the system root /// It is created from the user-specific folders within the system root
/// </summary> /// </summary>
public class CollectionFolder : Folder, ICollectionFolder, IByReferenceItem public class CollectionFolder : Folder, ICollectionFolder
{ {
/// <summary> /// <summary>
/// Gets a value indicating whether this instance is virtual folder. /// Gets a value indicating whether this instance is virtual folder.

@ -760,7 +760,7 @@ namespace MediaBrowser.Controller.Entities
var child = currentTuple.Item1; var child = currentTuple.Item1;
//refresh it //refresh it
await child.RefreshMetadata(cancellationToken, resetResolveArgs: child.IsFolder).ConfigureAwait(false); await child.RefreshMetadata(cancellationToken, resetResolveArgs: child.IsFolder, forceSave: currentTuple.Item2).ConfigureAwait(false);
// Refresh children if a folder and the item changed or recursive is set to true // Refresh children if a folder and the item changed or recursive is set to true
var refreshChildren = child.IsFolder && (currentTuple.Item2 || (recursive.HasValue && recursive.Value)); var refreshChildren = child.IsFolder && (currentTuple.Item2 || (recursive.HasValue && recursive.Value));

@ -126,7 +126,8 @@ namespace MediaBrowser.Controller.Providers
} }
data.Data = ConfigurationManager.ApplicationPaths.ItemsByNamePath.GetMD5(); data.Data = ConfigurationManager.ApplicationPaths.ItemsByNamePath.GetMD5();
SetLastRefreshed(item, DateTime.UtcNow);
return result; return result;
} }

@ -269,16 +269,16 @@ namespace MediaBrowser.Server.Implementations.Library
// Need to use DistinctBy Id because there could be multiple instances with the same id // Need to use DistinctBy Id because there could be multiple instances with the same id
// due to sharing the default library // due to sharing the default library
var userRootFolders = _userManager.Users.Select(i => i.RootFolder) var userRootFolders = _userManager.Users.Select(i => i.RootFolder)
.DistinctBy(i => i.Id) .Distinct()
.ToList(); .ToList();
items.AddRange(userRootFolders); items.AddRange(userRootFolders);
// Get all user collection folders // Get all user collection folders
// Skip BasePluginFolders because we already got them from RootFolder.RecursiveChildren
var userFolders = var userFolders =
_userManager.Users.SelectMany(i => i.RootFolder.Children) userRootFolders.SelectMany(i => i.Children)
.Where(i => !(i is BasePluginFolder)) .Where(i => !(i is BasePluginFolder))
.DistinctBy(i => i.Id)
.ToList(); .ToList();
items.AddRange(userFolders); items.AddRange(userFolders);

Loading…
Cancel
Save