mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-07 00:16:57 +08:00
fix local usage
This commit is contained in:
@@ -191,7 +191,8 @@ class LocalStorage(StorageBase):
|
|||||||
"""
|
"""
|
||||||
return Path(fileitem.path)
|
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: 上传目录项
|
:param fileitem: 上传目录项
|
||||||
@@ -260,8 +261,11 @@ class LocalStorage(StorageBase):
|
|||||||
"""
|
"""
|
||||||
存储使用情况
|
存储使用情况
|
||||||
"""
|
"""
|
||||||
library_dirs = DirectoryHelper().get_local_library_dirs()
|
directory_helper = DirectoryHelper()
|
||||||
total_storage, free_storage = SystemUtils.space_usage([Path(d.library_path) for d in library_dirs])
|
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(
|
return schemas.StorageUsage(
|
||||||
total=total_storage,
|
total=total_storage,
|
||||||
available=free_storage
|
available=free_storage
|
||||||
|
|||||||
Reference in New Issue
Block a user