fix: 统一了数据库查询中 season 参数的非空判断逻辑,以正确处理 season=0 的情况。

This commit is contained in:
jxxghp
2026-02-02 14:23:51 +08:00
parent d469c2d3f9
commit 17773913ae
5 changed files with 19 additions and 19 deletions

View File

@@ -92,7 +92,7 @@ class SubscribeOper(DbOper):
判断是否存在
"""
if tmdbid:
if season:
if season is not None:
return True if Subscribe.exists(self._db, tmdbid=tmdbid, season=season) else False
else:
return True if Subscribe.exists(self._db, tmdbid=tmdbid) else False
@@ -195,7 +195,7 @@ class SubscribeOper(DbOper):
判断是否存在订阅历史
"""
if tmdbid:
if season:
if season is not None:
return True if SubscribeHistory.exists(self._db, tmdbid=tmdbid, season=season) else False
else:
return True if SubscribeHistory.exists(self._db, tmdbid=tmdbid) else False