This commit is contained in:
EstrellaXD
2023-04-28 10:11:04 +08:00
parent 853e8a1fb1
commit bd6b7afa93
3 changed files with 6 additions and 6 deletions

View File

@@ -83,6 +83,6 @@ else:
if __name__ == "__main__":
log_config = uvicorn.config.LOGGING_CONFIG
log_config["formatters"]["default"]["fmt"] = "[%(asctime)s] %(levelname)-8s %(message)s"
main_process.start()
# main_process.start()
uvicorn.run(router, host="0.0.0.0", port=settings.program.webui_port, log_config=log_config)

View File

@@ -67,9 +67,9 @@ class DownloadClient:
self.client.rss_set_rule(rule_name=f"{rule_name} S{season}", rule_def=rule)
logger.info(f"Add {official_name} Season {season}")
def rss_feed(self, rss_link):
def rss_feed(self, rss_link, item_path="Mikan_RSS"):
# TODO: 定时刷新 RSS
if self.client.get_rss_info() == rss_link:
if self.client.get_rss_info(item_path) == rss_link:
logger.info("RSS Already exists.")
else:
logger.info("No feed exists, start adding feed.")

View File

@@ -66,8 +66,8 @@ class QbDownloader:
def torrents_rename_file(self, torrent_hash, old_path, new_path):
self._client.torrents_rename_file(torrent_hash=torrent_hash, old_path=old_path, new_path=new_path)
def get_rss_info(self):
item = self._client.rss_items().get("Mikan_RSS")
def get_rss_info(self, item_path: str = "Mikan_RSS"):
item = self._client.rss_items().get(item_path)
if item is not None:
return item.url
else:
@@ -75,7 +75,7 @@ class QbDownloader:
def rss_add_feed(self, url, item_path):
try:
if self.get_rss_info() is not None:
if self.get_rss_info(item_path) is not None:
self.rss_remove_item(item_path)
self._client.rss_add_feed(url, item_path)
except Conflict409Error: