Fix minor bug

This commit is contained in:
EstrellaXD
2023-04-26 22:34:09 +08:00
parent cfe1fba9c7
commit 6e4be5345b
4 changed files with 20 additions and 5 deletions

View File

@@ -31,6 +31,11 @@ class DownloadClient:
"rss_refresh_interval": 30,
}
self.client.prefs_init(prefs=prefs)
try:
self.client.add_category("BangumiCollection")
except Exception as e:
logger.warning("Cannot add new category, maybe already exists.")
logger.debug(e)
if settings.downloader.path == "":
prefs = self.client.get_app_prefs()
settings.downloader.path = os.path.join(prefs["save_path"], "Bangumi")

View File

@@ -42,6 +42,9 @@ class QbDownloader:
def get_app_prefs(self):
return self._client.app_preferences()
def add_category(self, category):
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)