feat: 增加刷流任务时支持触发插件事件

This commit is contained in:
InfinityPacer
2024-07-10 20:52:15 +08:00
parent 73a02274ad
commit 326bef0652

View File

@@ -25,6 +25,7 @@ from app.modules.qbittorrent import Qbittorrent
from app.modules.transmission import Transmission
from app.plugins import _PluginBase
from app.schemas import NotificationType, TorrentInfo, MediaType
from app.schemas.types import EventType
from app.utils.http import RequestUtils
from app.utils.string import StringUtils
@@ -2120,6 +2121,12 @@ class BrushFlow(_PluginBase):
"time": time.time()
}
self.eventmanager.send_event(etype=EventType.PluginAction, data={
"action": "brushflow_download_added",
"data": torrent_task
})
torrent_tasks[hash_string] = torrent_task
# 统计数据
torrents_size += torrent.size
statistic_info["count"] += 1