From b7d084148d9e0b1436f660ef4fc4cf6e1598d67b Mon Sep 17 00:00:00 2001 From: InfinityPacer <160988576+InfinityPacer@users.noreply.github.com> Date: Thu, 15 Aug 2024 17:49:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(BrushFlow):=20=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=95=B0=E9=87=8F=E8=B0=83=E6=95=B4=E4=B8=BA?= =?UTF-8?q?=E4=BB=85=E8=8E=B7=E5=8F=96=E5=88=B7=E6=B5=81=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E7=A7=8D=E5=AD=90=EF=BC=8C=E5=B9=B6=E5=AE=B9=E9=94=99=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/brushflow/__init__.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/plugins/brushflow/__init__.py b/plugins/brushflow/__init__.py index 656a013..74151ab 100644 --- a/plugins/brushflow/__init__.py +++ b/plugins/brushflow/__init__.py @@ -3641,12 +3641,21 @@ class BrushFlow(_PluginBase): """ 获取正在下载的任务数量 """ - brush_config = self.__get_brush_config() - downloader = self.__get_downloader(brush_config.downloader) - if not downloader: + try: + brush_config = self.__get_brush_config() + downloader = self.__get_downloader(brush_config.downloader) + if not downloader: + return 0 + + torrents = downloader.get_downloading_torrents(tags=brush_config.brush_tag) + if torrents is None: + logger.warn("获取下载数量失败,可能是下载器连接发生异常") + return 0 + + return len(torrents) + except Exception as e: + logger.error(f"获取下载数量发生异常: {e}") return 0 - torrents = downloader.get_downloading_torrents() - return len(torrents) or 0 @staticmethod def __get_pubminutes(pubdate: str) -> float: From f67b0ae460bcfbf0d781f0452d8ea62b18db2054 Mon Sep 17 00:00:00 2001 From: InfinityPacer <160988576+InfinityPacer@users.noreply.github.com> Date: Thu, 15 Aug 2024 17:50:45 +0800 Subject: [PATCH 2/2] fix BrushFlow v3.7 --- package.json | 3 ++- plugins/brushflow/__init__.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9c8ba5c..7830905 100644 --- a/package.json +++ b/package.json @@ -363,11 +363,12 @@ "name": "站点刷流", "description": "自动托管刷流,将会提高对应站点的访问频率。", "labels": "刷流,仪表板", - "version": "3.6", + "version": "3.7", "icon": "brush.jpg", "author": "jxxghp,InfinityPacer", "level": 2, "history": { + "v3.7": "下载数量调整为仅获取刷流标签种子并修复了一些细节问题", "v3.6": "优化检查服务中的时间管控", "v3.5": "移除「删种排除MoviePilot任务」配置项(请使用「删除排除标签」替代),完善刷流任务触发插件事件相关逻辑(联动H&R助手)", "v3.4": "移除「记录更多日志」配置项并调整为DEBUG日志,支持「删除排除标签」配置项,增加刷流任务时支持触发插件事件(联动H&R助手)", diff --git a/plugins/brushflow/__init__.py b/plugins/brushflow/__init__.py index 74151ab..e3d45b6 100644 --- a/plugins/brushflow/__init__.py +++ b/plugins/brushflow/__init__.py @@ -257,7 +257,7 @@ class BrushFlow(_PluginBase): # 插件图标 plugin_icon = "brush.jpg" # 插件版本 - plugin_version = "3.6" + plugin_version = "3.7" # 插件作者 plugin_author = "jxxghp,InfinityPacer" # 作者主页