mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-04-25 02:50:27 +08:00
fix: analyser api error.
eps complete logic.
This commit is contained in:
@@ -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 && \
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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="无法找到种子。",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user