fix: self-heal missing library root on access; accept .zip in admin upload picker
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user