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)
{
cancellationToken.ThrowIfCancellationRequested();
await LibraryManager.UpdateItem(this, cancellationToken).ConfigureAwait(false);
}
@ -1506,7 +1505,7 @@ namespace MediaBrowser.Controller.Entities
}
// 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.
/// It is created from the user-specific folders within the system root
/// </summary>
public class CollectionFolder : Folder, ICollectionFolder, IByReferenceItem
public class CollectionFolder : Folder, ICollectionFolder
{
/// <summary>
/// Gets a value indicating whether this instance is virtual folder.

@ -760,7 +760,7 @@ namespace MediaBrowser.Controller.Entities
var child = currentTuple.Item1;
//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
var refreshChildren = child.IsFolder && (currentTuple.Item2 || (recursive.HasValue && recursive.Value));

@ -126,7 +126,8 @@ namespace MediaBrowser.Controller.Providers
}
data.Data = ConfigurationManager.ApplicationPaths.ItemsByNamePath.GetMD5();
SetLastRefreshed(item, DateTime.UtcNow);
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
// due to sharing the default library
var userRootFolders = _userManager.Users.Select(i => i.RootFolder)
.DistinctBy(i => i.Id)
.Distinct()
.ToList();
items.AddRange(userRootFolders);
// Get all user collection folders
// Skip BasePluginFolders because we already got them from RootFolder.RecursiveChildren
var userFolders =
_userManager.Users.SelectMany(i => i.RootFolder.Children)
userRootFolders.SelectMany(i => i.Children)
.Where(i => !(i is BasePluginFolder))
.DistinctBy(i => i.Id)
.ToList();
items.AddRange(userFolders);

Loading…
Cancel
Save