浏览代码

Create directory before checking for size (#13962)

JPVenson 1 月之前
父节点
当前提交
2ea7af777b
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      Jellyfin.Server.Implementations/StorageHelpers/StorageHelper.cs

+ 5 - 0
Jellyfin.Server.Implementations/StorageHelpers/StorageHelper.cs

@@ -72,6 +72,11 @@ public static class StorageHelper
     private static void TestDataDirectorySize(string path, ILogger logger, long threshold = -1)
     {
         logger.LogDebug("Check path {TestPath} for storage capacity", path);
+        if (!Directory.Exists(path))
+        {
+            Directory.CreateDirectory(path);
+        }
+
         var drive = new DriveInfo(path);
         if (threshold != -1 && drive.AvailableFreeSpace < threshold)
         {