The Free Software Media System - Server Backend & API
fixed issue preventing drive contents from being read
Luke Pulverenti826c749774e8
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.csindex 8982801106..4bd1b1abaf 100644--- a/MediaBrowser.Controller/Entities/BaseItem.cs+++ b/MediaBrowser.Controller/Entities/BaseItem.cs@@ -391,8 +391,10 @@ namespace MediaBrowser.Controller.Entities{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))))+ foreach (var subPath in paths+ .Where(subPath => !subPath.EndsWith(":\\", StringComparison.OrdinalIgnoreCase) && paths.Any(i => subPath.StartsWith(i.TrimEnd(System.IO.Path.DirectorySeparatorChar) + System.IO.Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase)))){+ Logger.Info("Ignoring duplicate path: {0}", subPath);args.FileSystemDictionary.Remove(subPath);}}diff --git a/MediaBrowser.Controller/IO/FileData.cs b/MediaBrowser.Controller/IO/FileData.csindex 4b5aed3ab7..79ba0a64fa 100644--- a/MediaBrowser.Controller/IO/FileData.cs+++ b/MediaBrowser.Controller/IO/FileData.cs@@ -3,7 +3,6 @@ using MediaBrowser.Model.Logging;using System;using System.Collections.Generic;using System.IO;-using System.Linq;namespace MediaBrowser.Controller.IO{@@ -41,28 +40,17 @@ namespace MediaBrowser.Controller.IOif (resolveShortcuts && FileSystem.IsShortcut(entry.FullName)){var newPath = FileSystem.ResolveShortcut(entry.FullName);+if (string.IsNullOrWhiteSpace(newPath)){//invalid shortcut - could be old or target could just be unavailable- logger.Warn("Encountered invalid shortuct: " + entry.FullName);+ logger.Warn("Encountered invalid shortcut: " + entry.FullName);continue;}- var data = FileSystem.GetFileSystemInfo(newPath);- if (data.Exists)- {- // Find out if the shortcut is pointing to a directory or file- if (data.Attributes.HasFlag(FileAttributes.Directory))- {- // add to our physical locations- if (args != null)- {- args.AddAdditionalLocation(newPath);- }- }+ var data = FileSystem.GetFileSystemInfo(newPath);- dict[data.FullName] = data;- }+ dict[data.FullName] = data;}else if (flattenFolderDepth > 0 && isDirectory){diff --git a/MediaBrowser.Controller/IO/FileSystem.cs b/MediaBrowser.Controller/IO/FileSystem.csindex e5f80533aa..04eefd4a12 100644--- a/MediaBrowser.Controller/IO/FileSystem.cs+++ b/MediaBrowser.Controller/IO/FileSystem.cs@@ -34,7 +34,7 @@ namespace MediaBrowser.Controller.IO{var fileInfo = new DirectoryInfo(path);- if (fileInfo.Exists)+ if (fileInfo.Exists || path.EndsWith(":\\", StringComparison.OrdinalIgnoreCase)){return fileInfo;}