fixed image providers from running everytime against collection folders

This commit is contained in:
Luke Pulverenti
2013-05-18 17:47:00 -04:00
parent 5ecc276cb7
commit 99959f5d10
5 changed files with 8 additions and 8 deletions

View File

@@ -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);