소스 검색

consolidated some file system access

Luke Pulverenti 12 년 전
부모
커밋
2d0c51071a
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  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)
             {