Skip to content

Commit

Permalink
Merge pull request #2843 from InfinityPacer/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp authored Oct 12, 2024
2 parents 1a10f6d + b263489 commit 5224e67
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/modules/qbittorrent/qbittorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ def __login_qbittorrent(self) -> Optional[Client]:
logger.error(f"qbittorrent 连接出错:{str(err)}")
return None

def get_torrents(self, ids: Union[str, list] = None,
status: Union[str, list] = None,
tags: Union[str, list] = None) -> Tuple[List[TorrentDictionary], bool]:
def get_torrents(self, ids: Optional[Union[str, list]] = None,
status: Optional[str] = None,
tags: Optional[Union[str, list]] = None) -> Tuple[List[TorrentDictionary], bool]:
"""
获取种子列表
return: 种子列表, 是否发生异常
Expand Down Expand Up @@ -117,7 +117,7 @@ def get_completed_torrents(self, ids: Union[str, list] = None,
if not self.qbc:
return None
# completed会包含移动状态 改为获取seeding状态 包含活动上传, 正在做种, 及强制做种
torrents, error = self.get_torrents(status=["seeding"], ids=ids, tags=tags)
torrents, error = self.get_torrents(status="seeding", ids=ids, tags=tags)
return None if error else torrents or []

def get_downloading_torrents(self, ids: Union[str, list] = None,
Expand All @@ -129,7 +129,7 @@ def get_downloading_torrents(self, ids: Union[str, list] = None,
if not self.qbc:
return None
torrents, error = self.get_torrents(ids=ids,
status=["downloading"],
status="downloading",
tags=tags)
return None if error else torrents or []

Expand Down Expand Up @@ -195,7 +195,7 @@ def torrents_set_force_start(self, ids: Union[str, list]):
logger.error(f"设置强制作种出错:{str(err)}")

def __get_last_add_torrentid_by_tag(self, tags: Union[str, list],
status: Union[str, list] = None) -> Optional[str]:
status: Optional[str] = None) -> Optional[str]:
"""
根据种子的下载链接获取下载中或暂停的钟子的ID
:return: 种子ID
Expand All @@ -211,7 +211,7 @@ def __get_last_add_torrentid_by_tag(self, tags: Union[str, list],
return None

def get_torrent_id_by_tag(self, tags: Union[str, list],
status: Union[str, list] = None) -> Optional[str]:
status: Optional[str] = None) -> Optional[str]:
"""
通过标签多次尝试获取刚添加的种子ID,并移除标签
"""
Expand Down

0 comments on commit 5224e67

Please sign in to comment.