mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-03-20 03:57:30 +08:00
fix transfer_completed
This commit is contained in:
@@ -250,13 +250,13 @@ class TransmissionModule(_ModuleBase, _DownloaderBase):
|
||||
return ret_torrents
|
||||
|
||||
def transfer_completed(self, hashs: str, path: Path = None,
|
||||
downloader: str = None) -> None:
|
||||
downloader: str = None, transfer_type: str = None) -> None:
|
||||
"""
|
||||
转移完成后的处理
|
||||
:param hashs: 种子Hash
|
||||
:param path: 源目录
|
||||
:param downloader: 下载器
|
||||
:return: None
|
||||
:param transfer_type: 整理方式
|
||||
"""
|
||||
# 获取下载器
|
||||
server: Transmission = self.get_server(downloader)
|
||||
@@ -270,18 +270,16 @@ class TransmissionModule(_ModuleBase, _DownloaderBase):
|
||||
else:
|
||||
tags = ['已整理']
|
||||
server.set_torrent_tag(ids=hashs, tags=tags)
|
||||
# FIXME 移动模式删除种子
|
||||
"""
|
||||
if settings.TRANSFER_TYPE in ["move"]:
|
||||
# 移动模式删除种子
|
||||
if transfer_type and transfer_type in ["move"]:
|
||||
if self.remove_torrents(hashs):
|
||||
logger.info(f"移动模式删除种子成功:{hashs} ")
|
||||
# 删除残留文件
|
||||
# 删除本地残留文件
|
||||
if path and path.exists():
|
||||
files = SystemUtils.list_files(path, settings.RMT_MEDIAEXT)
|
||||
if not files:
|
||||
logger.warn(f"删除残留文件夹:{path}")
|
||||
shutil.rmtree(path, ignore_errors=True)
|
||||
"""
|
||||
|
||||
def remove_torrents(self, hashs: Union[str, list], delete_file: bool = True,
|
||||
downloader: str = None) -> Optional[bool]:
|
||||
|
||||
Reference in New Issue
Block a user