feat: qb 支持强制继续
This commit is contained in:
@ -131,6 +131,8 @@ class Settings(BaseSettings):
|
||||
QB_CATEGORY: bool = False
|
||||
# Qbittorrent按顺序下载
|
||||
QB_SEQUENTIAL: bool = True
|
||||
# Qbittorrent忽略队列限制,强制继续
|
||||
QB_FORCE_RESUME: bool = False
|
||||
# Transmission地址,IP:PORT
|
||||
TR_HOST: str = None
|
||||
# Transmission用户名
|
||||
|
@ -101,9 +101,15 @@ class QbittorrentModule(_ModuleBase):
|
||||
# 选择文件
|
||||
self.qbittorrent.set_files(torrent_hash=torrent_hash, file_ids=file_ids, priority=0)
|
||||
# 开始任务
|
||||
self.qbittorrent.start_torrents(torrent_hash)
|
||||
if settings.QB_FORCE_RESUME:
|
||||
# 强制继续
|
||||
self.qbittorrent.torrents_set_force_start(torrent_hash)
|
||||
else:
|
||||
self.qbittorrent.start_torrents(torrent_hash)
|
||||
return torrent_hash, f"添加下载成功,已选择集数:{sucess_epidised}"
|
||||
else:
|
||||
if settings.QB_FORCE_RESUME:
|
||||
self.qbittorrent.torrents_set_force_start(torrent_hash)
|
||||
return torrent_hash, "添加下载成功"
|
||||
|
||||
def list_torrents(self, status: TorrentStatus = None,
|
||||
|
Reference in New Issue
Block a user