mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-07-12 16:02:35 +08:00
refactor(helper): 将DirectoryHelper、RuleHelper和TorrentHelper方法改为静态方法
- 移除不必要的实例化操作,直接使用类方法
This commit is contained in:
@@ -533,7 +533,7 @@ class FileManagerModule(_ModuleBase):
|
||||
handler = TransHandler()
|
||||
ret_fileitems = []
|
||||
# 检查本地媒体库
|
||||
dest_dirs = DirectoryHelper().get_library_dirs()
|
||||
dest_dirs = DirectoryHelper.get_library_dirs()
|
||||
# 检查每一个媒体库目录
|
||||
for dest_dir in dest_dirs:
|
||||
# 存储
|
||||
|
||||
@@ -338,10 +338,9 @@ class LocalStorage(StorageBase):
|
||||
"""
|
||||
存储使用情况
|
||||
"""
|
||||
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]
|
||||
[Path(d.download_path) for d in DirectoryHelper.get_local_download_dirs() if d.download_path] +
|
||||
[Path(d.library_path) for d in DirectoryHelper.get_local_library_dirs() if d.library_path]
|
||||
)
|
||||
return schemas.StorageUsage(
|
||||
total=total_storage,
|
||||
|
||||
Reference in New Issue
Block a user