aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/BaseItem.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Entities/BaseItem.cs')
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index 974b3f864..2852843ef 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -279,7 +279,7 @@ namespace MediaBrowser.Controller.Entities
// Record the name of each file
// Need to sort these because accoring to msdn docs, our i/o methods are not guaranteed in any order
foreach (var file in ResolveArgs.FileSystemChildren
- .Where(i => !i.Attributes.HasFlag(FileAttributes.System))
+ .Where(i => (i.Attributes & FileAttributes.System) != FileAttributes.System)
.OrderBy(f => f.Name))
{
sb.Append(file.Name);
@@ -363,12 +363,15 @@ namespace MediaBrowser.Controller.Entities
return new ItemResolveArgs(ConfigurationManager.ApplicationPaths);
}
+ var isDirectory = false;
+
if (UseParentPathToCreateResolveArgs)
{
path = System.IO.Path.GetDirectoryName(path);
+ isDirectory = true;
}
- pathInfo = pathInfo ?? FileSystem.GetFileSystemInfo(path);
+ pathInfo = pathInfo ?? (isDirectory ? new DirectoryInfo(path) : FileSystem.GetFileSystemInfo(path));
if (pathInfo == null || !pathInfo.Exists)
{