fix #406 支持QB分类自动管理模式

This commit is contained in:
jxxghp
2023-09-03 07:56:20 +08:00
parent 31b460f89f
commit 0050a96faf
7 changed files with 28 additions and 10 deletions

View File

@ -37,13 +37,14 @@ class QbittorrentModule(_ModuleBase):
self.qbittorrent = Qbittorrent()
def download(self, torrent_path: Path, download_dir: Path, cookie: str,
episodes: Set[int] = None) -> Optional[Tuple[Optional[str], str]]:
episodes: Set[int] = None, category: str = None) -> Optional[Tuple[Optional[str], str]]:
"""
根据种子文件,选择并添加下载任务
:param torrent_path: 种子文件地址
:param download_dir: 下载目录
:param cookie: cookie
:param episodes: 需要下载的集数
:param category: 分类
:return: 种子Hash错误信息
"""
if not torrent_path or not torrent_path.exists():
@ -61,7 +62,8 @@ class QbittorrentModule(_ModuleBase):
download_dir=str(download_dir),
is_paused=is_paused,
tag=tags,
cookie=cookie)
cookie=cookie,
category=category)
if not state:
return None, f"添加种子任务失败:{torrent_path}"
else: