mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-05-16 13:55:28 +08:00
feat(qb): add support for ignoring category check via kwargs
This commit is contained in:
@@ -124,7 +124,8 @@ class QbittorrentModule(_ModuleBase, _DownloaderBase[Qbittorrent]):
|
|||||||
is_paused=is_paused,
|
is_paused=is_paused,
|
||||||
tag=tags,
|
tag=tags,
|
||||||
cookie=cookie,
|
cookie=cookie,
|
||||||
category=category
|
category=category,
|
||||||
|
ignore_category_check=False
|
||||||
)
|
)
|
||||||
if not state:
|
if not state:
|
||||||
# 读取种子的名称
|
# 读取种子的名称
|
||||||
|
|||||||
@@ -251,6 +251,7 @@ class Qbittorrent:
|
|||||||
:param category: 种子分类
|
:param category: 种子分类
|
||||||
:param download_dir: 下载路径
|
:param download_dir: 下载路径
|
||||||
:param cookie: 站点Cookie用于辅助下载种子
|
:param cookie: 站点Cookie用于辅助下载种子
|
||||||
|
:param kwargs: 可选参数,如 ignore_category_check 以及 QB相关参数
|
||||||
:return: bool
|
:return: bool
|
||||||
"""
|
"""
|
||||||
if not self.qbc or not content:
|
if not self.qbc or not content:
|
||||||
@@ -276,13 +277,16 @@ class Qbittorrent:
|
|||||||
else:
|
else:
|
||||||
tags = None
|
tags = None
|
||||||
|
|
||||||
# 分类自动管理
|
# 如果忽略分类检查,则直接使用传入的分类值,否则,仅在分类存在且启用了自动管理时才传递参数
|
||||||
if category and self._category:
|
ignore_category_check = kwargs.pop("ignore_category_check", True)
|
||||||
is_auto = True
|
if ignore_category_check:
|
||||||
|
is_auto = self._category
|
||||||
else:
|
else:
|
||||||
is_auto = False
|
if category and self._category:
|
||||||
category = None
|
is_auto = True
|
||||||
|
else:
|
||||||
|
is_auto = False
|
||||||
|
category = None
|
||||||
try:
|
try:
|
||||||
# 添加下载
|
# 添加下载
|
||||||
qbc_ret = self.qbc.torrents_add(urls=urls,
|
qbc_ret = self.qbc.torrents_add(urls=urls,
|
||||||
|
|||||||
Reference in New Issue
Block a user