fix actions

This commit is contained in:
jxxghp
2025-02-19 17:44:14 +08:00
parent 1317d9c4f0
commit b41de1a982
11 changed files with 179 additions and 72 deletions
+1 -6
View File
@@ -1,5 +1,4 @@
from app.actions import BaseAction
from app.chain.download import DownloadChain
from app.schemas import ActionParams, ActionContext
@@ -17,10 +16,6 @@ class FetchDownloadsAction(BaseAction):
_downloads = []
def __init__(self):
super().__init__()
self.downloadchain = DownloadChain()
@property
def name(self) -> str:
return "获取下载任务"
@@ -41,7 +36,7 @@ class FetchDownloadsAction(BaseAction):
"""
self._downloads = context.downloads
for download in self._downloads:
torrents = self.downloadchain.list_torrents(hashs=[download.download_id])
torrents = self.chain.list_torrents(hashs=[download.download_id])
if not torrents:
download.completed = True
continue