fix: self-heal missing library root on access; accept .zip in admin upload picker

This commit is contained in:
2026-09-07 20:16:26 +08:00
parent 6b3a4e5240
commit 505f660dbd
2 changed files with 6 additions and 2 deletions
+4
View File
@@ -26,6 +26,10 @@ func (a *api) libRoot(c *gin.Context, lib store.Library) (string, bool) {
err(c, http.StatusForbidden, "forbidden", "library root outside books dir")
return "", false
}
if e := os.MkdirAll(root, 0o755); e != nil { // 注册库时目录可能尚未落盘,自愈
err(c, http.StatusInternalServerError, "internal", "library root")
return "", false
}
return root, true
}