fix download contral

This commit is contained in:
jxxghp 2023-07-04 08:21:39 +08:00
parent 8adab8d645
commit fe7e84d5da
2 changed files with 4 additions and 4 deletions

View File

@ -259,7 +259,7 @@ class ChainBase(AbstractSingleton, metaclass=Singleton):
:param hashs: 种子Hash :param hashs: 种子Hash
:return: bool :return: bool
""" """
return self.run_module("start_torrent", hash_str=hashs) return self.run_module("start_torrents", hashs=hashs)
def stop_torrents(self, hashs: Union[list, str]) -> bool: def stop_torrents(self, hashs: Union[list, str]) -> bool:
""" """
@ -267,7 +267,7 @@ class ChainBase(AbstractSingleton, metaclass=Singleton):
:param hashs: 种子Hash :param hashs: 种子Hash
:return: bool :return: bool
""" """
return self.run_module("stop_torrent", hashs=hashs) return self.run_module("stop_torrents", hashs=hashs)
def media_exists(self, mediainfo: MediaInfo) -> Optional[ExistMediaInfo]: def media_exists(self, mediainfo: MediaInfo) -> Optional[ExistMediaInfo]:
""" """

View File

@ -555,11 +555,11 @@ class DownloadChain(ChainBase):
def set_downloading(self, hash_str, oper: str) -> bool: def set_downloading(self, hash_str, oper: str) -> bool:
""" """
控制下载任务 start/pause 控制下载任务 start/stop
""" """
if oper == "start": if oper == "start":
return self.start_torrents(hashs=[hash_str]) return self.start_torrents(hashs=[hash_str])
elif oper == "pause": elif oper == "stop":
return self.stop_torrents(hashs=[hash_str]) return self.stop_torrents(hashs=[hash_str])
return False return False