feat 多媒体库目录支持

This commit is contained in:
jxxghp
2023-07-14 20:49:16 +08:00
parent 94a5c5e2e2
commit 085409049d
4 changed files with 50 additions and 23 deletions

View File

@ -38,7 +38,9 @@ def storage(_: schemas.TokenPayload = Depends(verify_token)) -> Any:
查询存储空间信息
"""
if settings.LIBRARY_PATH:
total_storage, free_storage = SystemUtils.space_usage(Path(settings.LIBRARY_PATH))
total_storage, free_storage = SystemUtils.space_usage(
[Path(path) for path in settings.LIBRARY_PATH.split(",")]
)
else:
total_storage, free_storage = 0, 0
return schemas.Storage(

View File

@ -63,10 +63,13 @@ def arr_rootfolder(apikey: str) -> Any:
status_code=403,
detail="认证失败!",
)
library_path = "/"
if settings.LIBRARY_PATH:
library_path = settings.LIBRARY_PATH.split(",")[0]
return [
{
"id": 1,
"path": settings.LIBRARY_PATH,
"path": library_path,
"accessible": True,
"freeSpace": 0,
"unmappedFolders": []