Merge pull request #447 from InfinityPacer/main

This commit is contained in:
jxxghp
2024-08-16 10:21:56 +08:00
committed by GitHub
2 changed files with 17 additions and 7 deletions

View File

@@ -257,7 +257,7 @@ class BrushFlow(_PluginBase):
# 插件图标
plugin_icon = "brush.jpg"
# 插件版本
plugin_version = "3.6"
plugin_version = "3.7"
# 插件作者
plugin_author = "jxxghp,InfinityPacer"
# 作者主页
@@ -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: