diff --git a/Dockerfile b/Dockerfile index 02c9995c..af83d197 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,6 @@ RUN set -ex && \ shadow \ tini \ openssl \ - busybox-suid \ tzdata && \ python3 -m pip install --no-cache-dir --upgrade pip && \ sed -i '/bcrypt/d' requirements.txt && \ diff --git a/backend/src/module/database/bangumi.py b/backend/src/module/database/bangumi.py index ae4ed366..b484c6b0 100644 --- a/backend/src/module/database/bangumi.py +++ b/backend/src/module/database/bangumi.py @@ -144,7 +144,9 @@ class BangumiDatabase: # Find eps_complete = False # use `false()` to avoid E712 checking # see: https://docs.astral.sh/ruff/rules/true-false-comparison/ - condition = select(Bangumi).where(Bangumi.eps_collect == false()) + condition = select(Bangumi).where( + and_(Bangumi.eps_collect == false(), Bangumi.deleted == false()) + ) datas = self.session.exec(condition).all() return datas diff --git a/backend/src/module/rss/analyser.py b/backend/src/module/rss/analyser.py index af1bc79a..81fd0e36 100644 --- a/backend/src/module/rss/analyser.py +++ b/backend/src/module/rss/analyser.py @@ -82,14 +82,22 @@ class RSSAnalyser(TitleParser): def link_to_data(self, rss: RSSItem) -> Bangumi | ResponseModel: torrents = self.get_rss_torrents(rss.url, False) - for torrent in torrents: - data = self.torrent_to_data(torrent, rss) - if data: - return data - else: - return ResponseModel( - status=False, - status_code=406, - msg_en="Cannot parse this link.", - msg_zh="无法解析此链接。", - ) + if not torrents: + for torrent in torrents: + data = self.torrent_to_data(torrent, rss) + if data: + return data + else: + return ResponseModel( + status=False, + status_code=406, + msg_en="Cannot parse this link.", + msg_zh="无法解析此链接。", + ) + else: + return ResponseModel( + status=False, + status_code=406, + msg_en="Cannot find any torrent.", + msg_zh="无法找到种子。", + )