Explorar o código

consolidated some file system access

Luke Pulverenti %!s(int64=12) %!d(string=hai) anos
pai
achega
2d0c51071a
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      MediaBrowser.Controller/Providers/ImagesByNameProvider.cs

+ 4 - 2
MediaBrowser.Controller/Providers/ImagesByNameProvider.cs

@@ -84,12 +84,14 @@ namespace MediaBrowser.Controller.Providers
             // If the IBN location exists return the last modified date of any file in it
             var location = GetLocation(item);
 
-            if (!Directory.Exists(location))
+            var directoryInfo = new DirectoryInfo(location);
+
+            if (!directoryInfo.Exists)
             {
                 return DateTime.MinValue;
             }
 
-            var files = new DirectoryInfo(location).EnumerateFiles().ToList();
+            var files = directoryInfo.EnumerateFiles().ToList();
 
             if (files.Count == 0)
             {