mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-03-20 03:57:30 +08:00
- 修复整理原盘报错的问题
- 添加类型注解
This commit is contained in:
@@ -194,7 +194,9 @@ class TransferChain(ChainBase):
|
||||
transfers: Dict[Tuple, TransferInfo] = {}
|
||||
|
||||
# 待整理文件列表
|
||||
file_items = []
|
||||
file_items: List[FileItem] = []
|
||||
# 蓝光目录列表
|
||||
bluray: List[FileItem] = []
|
||||
# 汇总错误信息
|
||||
err_msgs: List[str] = []
|
||||
# 已处理数量
|
||||
@@ -225,9 +227,13 @@ class TransferChain(ChainBase):
|
||||
if (trans_item.type == "dir"
|
||||
and not (trans_item.storage == "local" and SystemUtils.is_bluray_dir(item_path))):
|
||||
# 遍历获取下载目录所有文件(递归)
|
||||
file_items = self.storagechain.list_files(trans_item, recursion=True)
|
||||
if file_items:
|
||||
file_items.extend(trans_items)
|
||||
files = self.storagechain.list_files(trans_item, recursion=True)
|
||||
if files:
|
||||
file_items.extend(files)
|
||||
elif (trans_item.storage == "local" and SystemUtils.is_bluray_dir(item_path)):
|
||||
# 计算目录下文件总大小
|
||||
trans_item.size = sum(file.stat().st_size for file in item_path.rglob('*') if file.is_file())
|
||||
bluray.append(trans_item)
|
||||
else:
|
||||
# 文件或蓝光目录
|
||||
file_items.append(trans_item)
|
||||
@@ -240,7 +246,8 @@ class TransferChain(ChainBase):
|
||||
file_items = [f for f in file_items
|
||||
if f.extension and (f".{f.extension.lower()}" in self.all_exts
|
||||
and (not min_filesize or f.size > min_filesize * 1024 * 1024))]
|
||||
|
||||
# BDMV 跳过过滤
|
||||
file_items.extend(bluray)
|
||||
if not file_items:
|
||||
logger.warn(f"{fileitem.path} 没有找到可整理的媒体文件")
|
||||
return False, f"{fileitem.name} 没有找到可整理的媒体文件"
|
||||
|
||||
Reference in New Issue
Block a user