From 29725def343aaf7e7c868701151e9383a5059364 Mon Sep 17 00:00:00 2001 From: xuzhi Date: Sat, 18 May 2024 06:57:48 +0000 Subject: [PATCH] Update cleaninvalidseed to v1.4 --- package.json | 3 ++- plugins/cleaninvalidseed/__init__.py | 13 ++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 86c92f5..29c758d 100644 --- a/package.json +++ b/package.json @@ -702,11 +702,12 @@ "name": "清理QB无效做种", "description": "清理已经被站点删除的种子及对应源文件,仅支持QB", "labels": "Qbittorrent", - "version": "1.3", + "version": "1.4", "icon": "clean_a.png", "author": "DzAvril", "level": 1, "history": { + "v1.4": "修复插件功能失效的问题", "v1.3": "1. 增加远程命令 2. 根据tracker error_message字段进行过滤,避免误删", "v1.2": "修复配置页空白的问题", "v1.1": "更新使用说明,以防使用不当误删文件", diff --git a/plugins/cleaninvalidseed/__init__.py b/plugins/cleaninvalidseed/__init__.py index f05ae71..219b634 100644 --- a/plugins/cleaninvalidseed/__init__.py +++ b/plugins/cleaninvalidseed/__init__.py @@ -28,7 +28,7 @@ class CleanInvalidSeed(_PluginBase): # 插件图标 plugin_icon = "clean_a.png" # 插件版本 - plugin_version = "1.3" + plugin_version = "1.4" # 插件作者 plugin_author = "DzAvril" # 作者主页 @@ -160,25 +160,24 @@ class CleanInvalidSeed(_PluginBase): self._delete_invalid_torrents = False self._detect_invalid_files = False self._delete_invalid_files = False + self.clean_invalid_seed() elif event_data.get("action") == "delete_invalid_torrents": logger.info("收到远程命令,开始清理无效做种") self._delete_invalid_torrents = True self._detect_invalid_files = False self._delete_invalid_files = False + self.clean_invalid_seed() elif event_data.get("action") == "detect_invalid_files": logger.info("收到远程命令,开始检测无效源文件") - self._delete_invalid_torrents = False - self._detect_invalid_files = True self._delete_invalid_files = False + self.detect_invalid_files() elif event_data.get("action") == "delete_invalid_files": logger.info("收到远程命令,开始清理无效源文件") - self._delete_invalid_torrents = False - self._detect_invalid_files = True self._delete_invalid_files = True + self.detect_invalid_files() else: logger.error("收到未知远程命令") return - self.clean_invalid_seed() self._delete_invalid_torrents = old_delete_invalid_torrents self._detect_invalid_files = old_detect_invalid_files self._delete_invalid_files = old_delete_invalid_files @@ -246,13 +245,13 @@ class CleanInvalidSeed(_PluginBase): for tracker in trackers: if tracker.get("tier") == -1: continue + tracker_domian = StringUtils.get_url_netloc((tracker.get("url")))[1] if tracker.get("status") == 4: # 仅调试用 logger.info(f"tracker未工作的种子:{torrent.name},Tracker: {tracker_domian},大小:{StringUtils.str_filesize(torrent.size)},原因:{tracker.msg}\n") if not ((tracker.get("status") == 4) and (tracker.get("msg") in self._error_msg)): is_invalid = False - tracker_domian = StringUtils.get_url_netloc((tracker.get("url")))[1] working_tracker_set.add(tracker_domian) if is_invalid: temp_invalid_torrents.append(torrent)