fixes #305 - Multiple collections

This commit is contained in:
Luke Pulverenti
2013-05-24 13:48:48 -04:00
parent 398b658dbe
commit 7a5ba39603
4 changed files with 31 additions and 13 deletions

View File

@@ -430,6 +430,18 @@ namespace MediaBrowser.Server.Implementations.Library
var flattenFolderDepth = isPhysicalRoot ? 2 : 0;
args.FileSystemDictionary = FileData.GetFilteredFileSystemEntries(args.Path, _logger, flattenFolderDepth: flattenFolderDepth, args: args, resolveShortcuts: isPhysicalRoot || args.IsVf);
// Need to remove subpaths that may have been resolved from shortcuts
// Example: if \\server\movies exists, then strip out \\server\movies\action
if (isPhysicalRoot)
{
var paths = args.FileSystemDictionary.Keys.ToList();
foreach (var subPath in paths.Where(subPath => paths.Any(i => subPath.StartsWith(i.TrimEnd(System.IO.Path.DirectorySeparatorChar) + System.IO.Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase))))
{
args.FileSystemDictionary.Remove(subPath);
}
}
}
// Check to see if we should resolve based on our contents