mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
fix downloader task status queries
This commit is contained in:
@@ -22,7 +22,7 @@ from app.helper.directory import DirectoryHelper
|
||||
from app.helper.thread import ThreadHelper
|
||||
from app.helper.torrent import TorrentHelper
|
||||
from app.log import logger
|
||||
from app.schemas import ExistMediaInfo, FileURI, NotExistMediaInfo, DownloadingTorrent, Notification, ResourceSelectionEventData, \
|
||||
from app.schemas import ExistMediaInfo, FileURI, NotExistMediaInfo, DownloaderTorrent, Notification, ResourceSelectionEventData, \
|
||||
ResourceDownloadEventData
|
||||
from app.schemas.types import MediaType, TorrentStatus, EventType, MessageChannel, NotificationType, ContentType, \
|
||||
ChainEventType
|
||||
@@ -1359,7 +1359,7 @@ class DownloadChain(ChainBase):
|
||||
link=settings.MP_DOMAIN('#/downloading')
|
||||
))
|
||||
|
||||
def downloading(self, name: Optional[str] = None) -> List[DownloadingTorrent]:
|
||||
def downloading(self, name: Optional[str] = None) -> List[DownloaderTorrent]:
|
||||
"""
|
||||
查询正在下载的任务
|
||||
"""
|
||||
@@ -1417,7 +1417,7 @@ class DownloadChain(ChainBase):
|
||||
return
|
||||
logger.warn(f"检测到下载源文件被删除,删除下载任务(不含文件):{hash_str}")
|
||||
# 先查询种子
|
||||
torrents: List[schemas.TransferTorrent] = self.list_torrents(hashs=[hash_str])
|
||||
torrents: List[schemas.DownloaderTorrent] = self.list_torrents(hashs=[hash_str])
|
||||
if torrents:
|
||||
self.remove_torrents(hashs=[hash_str], delete_file=False)
|
||||
# 发出下载任务删除事件,如需处理辅种,可监听该事件
|
||||
|
||||
Reference in New Issue
Block a user