diff --git a/app/modules/filemanager/storages/local.py b/app/modules/filemanager/storages/local.py index 84f448a0..8467dbb0 100644 --- a/app/modules/filemanager/storages/local.py +++ b/app/modules/filemanager/storages/local.py @@ -191,7 +191,8 @@ class LocalStorage(StorageBase): """ return Path(fileitem.path) - def upload(self, fileitem: schemas.FileItem, path: Path, new_name: Optional[str] = None) -> Optional[schemas.FileItem]: + def upload(self, fileitem: schemas.FileItem, path: Path, new_name: Optional[str] = None) -> Optional[ + schemas.FileItem]: """ 上传文件 :param fileitem: 上传目录项 @@ -260,8 +261,11 @@ class LocalStorage(StorageBase): """ 存储使用情况 """ - library_dirs = DirectoryHelper().get_local_library_dirs() - total_storage, free_storage = SystemUtils.space_usage([Path(d.library_path) for d in library_dirs]) + directory_helper = DirectoryHelper() + total_storage, free_storage = SystemUtils.space_usage( + [Path(d.download_path) for d in directory_helper.get_local_download_dirs() if d.download_path] + + [Path(d.library_path) for d in directory_helper.get_local_library_dirs() if d.library_path] + ) return schemas.StorageUsage( total=total_storage, available=free_storage