diff --git a/app/chain/__init__.py b/app/chain/__init__.py index f91e4503..f79153ae 100644 --- a/app/chain/__init__.py +++ b/app/chain/__init__.py @@ -307,13 +307,13 @@ class ChainBase(metaclass=ABCMeta): """ return self.run_module("stop_torrents", hashs=hashs) - def get_torrent_files(self, tid: str) -> Optional[Tuple[Optional[str], str]]: + def torrent_files(self, tid: str) -> Optional[Tuple[Optional[str], str]]: """ 根据种子文件,选择并添加下载任务 :param tid: 种子Hash :return: 种子文件 """ - return self.run_module("get_files", tid=tid) + return self.run_module("torrent_files", tid=tid) def media_exists(self, mediainfo: MediaInfo, itemid: str = None) -> Optional[ExistMediaInfo]: """ diff --git a/app/chain/download.py b/app/chain/download.py index f4571270..c5000561 100644 --- a/app/chain/download.py +++ b/app/chain/download.py @@ -631,7 +631,7 @@ class DownloadChain(ChainBase): 获取种子文件清单 """ try: - return self.get_torrent_files(tid=tid) + return self.torrent_files(tid=tid) except Exception as err: logger.error(f"获取种子文件列表出错:{err}") - return [] + return None diff --git a/app/modules/qbittorrent/qbittorrent.py b/app/modules/qbittorrent/qbittorrent.py index 3b33e1e6..dda1625d 100644 --- a/app/modules/qbittorrent/qbittorrent.py +++ b/app/modules/qbittorrent/qbittorrent.py @@ -265,7 +265,7 @@ class Qbittorrent(metaclass=Singleton): logger.error(f"删除种子出错:{err}") return False - def get_files(self, tid: str) -> Optional[TorrentFilesList]: + def torrent_files(self, tid: str) -> Optional[TorrentFilesList]: """ 获取种子文件清单 """ diff --git a/app/modules/transmission/transmission.py b/app/modules/transmission/transmission.py index 24f0c0b4..afefef7d 100644 --- a/app/modules/transmission/transmission.py +++ b/app/modules/transmission/transmission.py @@ -192,7 +192,7 @@ class Transmission(metaclass=Singleton): logger.error(f"删除种子出错:{err}") return False - def get_files(self, tid: str) -> Optional[List[File]]: + def torrent_files(self, tid: str) -> Optional[List[File]]: """ 获取种子文件列表 """ diff --git a/app/plugins/mediasyncdel/__init__.py b/app/plugins/mediasyncdel/__init__.py index 217dc80c..02b98fb4 100644 --- a/app/plugins/mediasyncdel/__init__.py +++ b/app/plugins/mediasyncdel/__init__.py @@ -485,10 +485,6 @@ class MediaSyncDel(_PluginBase): for transferhis in transfer_history: image = transferhis.image year = transferhis.year - if media_type == "Episode" or media_type == "Movie": - # 如果有剧集或者电影有多个版本的话,需要根据名称筛选下要删除的版本 - if os.path.basename(transferhis.dest) != os.path.basename(media_path): - continue # 删除种子任务 if self._del_source: del_source = False @@ -748,7 +744,6 @@ class MediaSyncDel(_PluginBase): dl_file_name = dl_file.get("name") if not stop_from: torrent_file = os.path.join(src, os.path.basename(dl_file_name)) - logger.error(f"种子路径 {torrent_file} {Path(torrent_file).exists()}") if Path(torrent_file).exists(): logger.info(f"种子有文件被删除,种子文件{torrent_file}暂未删除,暂停种子") delete_flag = False