From 65dfe843066e721985cceea89d2e6fc4b6900b9c Mon Sep 17 00:00:00 2001 From: snowlocked <19562649+snowlocked@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:22:17 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E7=A7=8D=E5=AD=90=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E5=90=8E=E6=8A=8A=E7=A7=8D=E5=AD=90=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E6=95=B0=E6=8D=AE=E5=BA=93=E9=87=8C=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/module/rss/engine.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/module/rss/engine.py b/backend/src/module/rss/engine.py index 244a6ab55..fcf9ee679 100644 --- a/backend/src/module/rss/engine.py +++ b/backend/src/module/rss/engine.py @@ -122,14 +122,17 @@ def refresh_rss(self, client: DownloadClient, rss_id: Optional[int] = None): for rss_item in rss_items: new_torrents = self.pull_rss(rss_item) # Get all enabled bangumi data + add_torrents = [] + # Get all enabled bangumi data for torrent in new_torrents: matched_data = self.match_torrent(torrent) if matched_data: if client.add_torrent(torrent, matched_data): logger.debug(f"[Engine] Add torrent {torrent.name} to client") - torrent.downloaded = True + torrent.downloaded = True + add_torrents.append(torrent) # Add all torrents to database - self.torrent.add_all(new_torrents) + self.torrent.add_all(add_torrents) def download_bangumi(self, bangumi: Bangumi): with RequestContent() as req: From 0e2f41e66e451ab78ffce1fea86233e51e3a76ea Mon Sep 17 00:00:00 2001 From: snowlocked <19562649+snowlocked@users.noreply.github.com> Date: Thu, 25 Jul 2024 19:16:13 +0800 Subject: [PATCH 2/2] Update engine.py --- backend/src/module/rss/engine.py | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/src/module/rss/engine.py b/backend/src/module/rss/engine.py index fcf9ee679..66feb42be 100644 --- a/backend/src/module/rss/engine.py +++ b/backend/src/module/rss/engine.py @@ -123,7 +123,6 @@ def refresh_rss(self, client: DownloadClient, rss_id: Optional[int] = None): new_torrents = self.pull_rss(rss_item) # Get all enabled bangumi data add_torrents = [] - # Get all enabled bangumi data for torrent in new_torrents: matched_data = self.match_torrent(torrent) if matched_data: