From efd637182e40f69ba5a38e2c2cfc97a24ea34020 Mon Sep 17 00:00:00 2001 From: EstrellaXD Date: Thu, 1 Jun 2023 09:51:07 +0800 Subject: [PATCH] fix: many bugs --- Dockerfile | 2 +- src/module/core/sub_thread.py | 2 ++ src/module/manager/collector.py | 4 ++-- src/module/manager/torrent.py | 2 +- src/module/rss/add_rules.py | 5 ----- 5 files changed, 6 insertions(+), 9 deletions(-) delete mode 100644 src/module/rss/add_rules.py diff --git a/Dockerfile b/Dockerfile index 4fc98006..7f58121f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,7 @@ RUN apk add --no-cache \ sed -i '/bcrypt/d' requirements.txt && \ pip install --no-cache-dir -r requirements.txt && \ # Download WebUI - curl -sL "https://github.com/Rewrite0/Auto_Bangumi_WebUI/releases/download/v2.0.0-beta1/dist.zip" | busybox unzip -q -d /app - && \ + curl -sL "https://github.com/Rewrite0/Auto_Bangumi_WebUI/releases/latest/download/dist.zip" | busybox unzip -q -d /app - && \ mv /app/dist /app/templates && \ # Add user addgroup -S ab -g 911 && \ diff --git a/src/module/core/sub_thread.py b/src/module/core/sub_thread.py index 74725612..33f9d1c5 100644 --- a/src/module/core/sub_thread.py +++ b/src/module/core/sub_thread.py @@ -1,4 +1,5 @@ import threading +import time from .status import ProgramStatus @@ -64,6 +65,7 @@ def rename_loop(self): with PostNotification() as notifier: for info in renamed_info: notifier.send_msg(info) + time.sleep(2) self.stop_event.wait(settings.program.rename_time) def rename_start(self): diff --git a/src/module/manager/collector.py b/src/module/manager/collector.py index dc1c2de0..dbc3b798 100644 --- a/src/module/manager/collector.py +++ b/src/module/manager/collector.py @@ -28,9 +28,9 @@ def collect_season(self, data: BangumiData, link: str = None): logger.info("Completed!") def subscribe_season(self, data: BangumiData): - data.added = True - data.eps_collect = True with BangumiDatabase() as db: + data.added = True + data.eps_collect = True db.insert(data) self.add_rss_feed(data.rss_link[0], item_path=data.official_title) self.set_rule(data) diff --git a/src/module/manager/torrent.py b/src/module/manager/torrent.py index 9325f259..168e8024 100644 --- a/src/module/manager/torrent.py +++ b/src/module/manager/torrent.py @@ -12,7 +12,7 @@ class TorrentManager(BangumiDatabase): @staticmethod def __match_torrents_list(data: BangumiData) -> list: with DownloadClient() as client: - torrents = client.get_torrent_info() + torrents = client.get_torrent_info(status_filter=None) return [torrent.hash for torrent in torrents if torrent.save_path == data.save_path] def delete_torrents(self, data: BangumiData, client: DownloadClient): diff --git a/src/module/rss/add_rules.py b/src/module/rss/add_rules.py deleted file mode 100644 index e721ca6a..00000000 --- a/src/module/rss/add_rules.py +++ /dev/null @@ -1,5 +0,0 @@ -from module.database import BangumiDatabase -from module.downloader import DownloadClient - - -