aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-11-13 15:56:26 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-11-13 15:56:26 -0500
commit73c772637ec333c190e66c1fcd2eda2a9995fb82 (patch)
treee151c0b73596b4a70d9555264da0f573ab28769c
parent0c0c017b2f8cf2d94a6092a84e2a42426345feb8 (diff)
restore changes
-rw-r--r--MediaBrowser.Server.Implementations/Library/LibraryManager.cs15
1 files changed, 10 insertions, 5 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
index 328e558cb..6206c0b8b 100644
--- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
@@ -603,9 +603,9 @@ namespace MediaBrowser.Server.Implementations.Library
// Example: if \\server\movies exists, then strip out \\server\movies\action
if (isPhysicalRoot)
{
- var paths = NormalizeRootPathList(fileSystemDictionary.Keys);
+ var paths = NormalizeRootPathList(fileSystemDictionary.Values);
- fileSystemDictionary = paths.Select(_fileSystem.GetDirectoryInfo).ToDictionary(i => i.FullName);
+ fileSystemDictionary = paths.ToDictionary(i => i.FullName);
}
args.FileSystemDictionary = fileSystemDictionary;
@@ -625,9 +625,12 @@ namespace MediaBrowser.Server.Implementations.Library
return EntityResolutionIgnoreRules.Any(r => r.ShouldIgnore(file, parent));
}
- public IEnumerable<string> NormalizeRootPathList(IEnumerable<string> paths)
+ public IEnumerable<FileSystemMetadata> NormalizeRootPathList(IEnumerable<FileSystemMetadata> paths)
{
- var list = paths.Select(_fileSystem.NormalizePath)
+ var originalList = paths.ToList();
+
+ var list = originalList.Where(i => i.IsDirectory)
+ .Select(i => _fileSystem.NormalizePath(i.FullName))
.Distinct(StringComparer.OrdinalIgnoreCase)
.ToList();
@@ -639,7 +642,9 @@ namespace MediaBrowser.Server.Implementations.Library
_logger.Info("Found duplicate path: {0}", dupe);
}
- return list.Except(dupes, StringComparer.OrdinalIgnoreCase);
+ var newList = list.Except(dupes, StringComparer.OrdinalIgnoreCase).Select(_fileSystem.GetDirectoryInfo).ToList();
+ newList.AddRange(originalList.Where(i => !i.IsDirectory));
+ return newList;
}
/// <summary>