瀏覽代碼

Merge pull request #769 from EraYaN/fix-removed-filesystem-wrapper-conditions

Fix conditions where the ! was swallowed in #726
Joshua M. Boniface 6 年之前
父節點
當前提交
795f2c8774
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 2 2
      MediaBrowser.Api/EnvironmentService.cs
  2. 1 1
      MediaBrowser.Api/Library/LibraryStructureService.cs

+ 2 - 2
MediaBrowser.Api/EnvironmentService.cs

@@ -144,7 +144,7 @@ namespace MediaBrowser.Api
                 }
                 else
                 {
-                    if (Directory.Exists(request.Path))
+                    if (!Directory.Exists(request.Path))
                     {
                         throw new FileNotFoundException("File not found", request.Path);
                     }
@@ -153,7 +153,7 @@ namespace MediaBrowser.Api
 
             else
             {
-                if (!File.Exists(request.Path) && Directory.Exists(request.Path))
+                if (!File.Exists(request.Path) && !Directory.Exists(request.Path))
                 {
                     throw new FileNotFoundException("Path not found", request.Path);
                 }

+ 1 - 1
MediaBrowser.Api/Library/LibraryStructureService.cs

@@ -255,7 +255,7 @@ namespace MediaBrowser.Api.Library
             var currentPath = Path.Combine(rootFolderPath, request.Name);
             var newPath = Path.Combine(rootFolderPath, request.NewName);
 
-            if (Directory.Exists(currentPath))
+            if (!Directory.Exists(currentPath))
             {
                 throw new FileNotFoundException("The media collection does not exist");
             }