This commit is contained in:
jxxghp
2023-08-24 09:11:02 +08:00
parent 9607c398ff
commit b435b84782
4 changed files with 8 additions and 6 deletions

View File

@ -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}")