fix bug
This commit is contained in:
parent
9607c398ff
commit
b435b84782
@ -287,7 +287,7 @@ class ChainBase(metaclass=ABCMeta):
|
||||
return self.run_module("transfer", path=path, mediainfo=mediainfo,
|
||||
transfer_type=transfer_type, target=target, meta=meta)
|
||||
|
||||
def transfer_completed(self, hashs: Union[str, list], transinfo: TransferInfo) -> None:
|
||||
def transfer_completed(self, hashs: Union[str, list], transinfo: TransferInfo = None) -> None:
|
||||
"""
|
||||
转移完成后的处理
|
||||
:param hashs: 种子Hash
|
||||
|
@ -102,7 +102,7 @@ class TransferChain(ChainBase):
|
||||
f"回复:```\n/redo {his.id} [tmdbid]|[类型]\n``` 手动识别转移。"
|
||||
))
|
||||
# 设置种子状态,避免一直报错
|
||||
self.transfer_completed(hashs=torrent.hash, transinfo=transferinfo)
|
||||
self.transfer_completed(hashs=torrent.hash)
|
||||
continue
|
||||
|
||||
logger.info(f"{torrent.title} 识别为:{mediainfo.type.value} {mediainfo.title_year}")
|
||||
|
@ -155,7 +155,8 @@ class QbittorrentModule(_ModuleBase):
|
||||
return None
|
||||
return ret_torrents
|
||||
|
||||
def transfer_completed(self, hashs: Union[str, list], transinfo: TransferInfo) -> None:
|
||||
def transfer_completed(self, hashs: Union[str, list],
|
||||
transinfo: TransferInfo = None) -> None:
|
||||
"""
|
||||
转移完成后的处理
|
||||
:param hashs: 种子Hash
|
||||
@ -167,7 +168,7 @@ class QbittorrentModule(_ModuleBase):
|
||||
if self.remove_torrents(hashs):
|
||||
logger.info(f"移动模式删除种子成功:{hashs} ")
|
||||
# 删除残留文件
|
||||
if transinfo.path and transinfo.path.exists():
|
||||
if transinfo and transinfo.path and transinfo.path.exists():
|
||||
files = SystemUtils.list_files(transinfo.path, settings.RMT_MEDIAEXT)
|
||||
if not files:
|
||||
logger.warn(f"删除残留文件夹:{transinfo.path}")
|
||||
|
@ -138,7 +138,8 @@ class TransmissionModule(_ModuleBase):
|
||||
return None
|
||||
return ret_torrents
|
||||
|
||||
def transfer_completed(self, hashs: Union[str, list], transinfo: TransferInfo) -> None:
|
||||
def transfer_completed(self, hashs: Union[str, list],
|
||||
transinfo: TransferInfo = None) -> None:
|
||||
"""
|
||||
转移完成后的处理
|
||||
:param hashs: 种子Hash
|
||||
@ -151,7 +152,7 @@ class TransmissionModule(_ModuleBase):
|
||||
if self.remove_torrents(hashs):
|
||||
logger.info(f"移动模式删除种子成功:{hashs} ")
|
||||
# 删除残留文件
|
||||
if transinfo.path and transinfo.path.exists():
|
||||
if transinfo and transinfo.path and transinfo.path.exists():
|
||||
files = SystemUtils.list_files(transinfo.path, settings.RMT_MEDIAEXT)
|
||||
if not files:
|
||||
logger.warn(f"删除残留文件夹:{transinfo.path}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user