From bd956d8c422df001360a868c75c5d83bc4fc0eda Mon Sep 17 00:00:00 2001 From: EstrellaXD Date: Sun, 21 May 2023 14:03:35 +0800 Subject: [PATCH] feat: New wiki --- src/module/downloader/client/qb_downloader.py | 7 +++++-- src/module/downloader/download_client.py | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/module/downloader/client/qb_downloader.py b/src/module/downloader/client/qb_downloader.py index fbd658a8..a242366c 100644 --- a/src/module/downloader/client/qb_downloader.py +++ b/src/module/downloader/client/qb_downloader.py @@ -67,8 +67,8 @@ class QbDownloader: return self._client.torrents_createCategory(name=category) @qb_connect_failed_wait - def torrents_info(self, status_filter, category): - return self._client.torrents_info(status_filter, category) + def torrents_info(self, status_filter, category, tag=None): + return self._client.torrents_info(status_filter=status_filter, category=category, tag=tag) def torrents_add(self, urls, save_path, category): return self._client.torrents_add( @@ -125,3 +125,6 @@ class QbDownloader: def remove_rule(self, rule_name): self._client.rss_remove_rule(rule_name) + + def add_tag(self, _hash, tag): + self._client.torrents_add_tags(tags=tag, hashes=_hash) diff --git a/src/module/downloader/download_client.py b/src/module/downloader/download_client.py index 829b7355..3aa24298 100644 --- a/src/module/downloader/download_client.py +++ b/src/module/downloader/download_client.py @@ -90,8 +90,8 @@ class DownloadClient(TorrentPath): self.set_rule(info) logger.debug("Finished.") - def get_torrent_info(self, category="Bangumi"): - return self.client.torrents_info(status_filter="completed", category=category) + def get_torrent_info(self, category="Bangumi", status_filter="completed", tags=None): + return self.client.torrents_info(status_filter=status_filter, category=category, tags=tags) def rename_torrent_file(self, _hash, old_path, new_path) -> bool: logger.info(f"{old_path} >> {new_path}")