fix 手动修改过订阅总集数后,不再随tmdb变化

This commit is contained in:
thsrite
2024-03-06 19:33:31 +08:00
parent bbf1ec4c50
commit fa890ca29c
4 changed files with 37 additions and 1 deletions

View File

@@ -111,6 +111,9 @@ def update_subscribe(
# 没有缺失集数时缺失集数清空避免更新为0
subscribe_dict.pop("lack_episode")
elif subscribe_in.total_episode:
# 是否手动修改过总集数
if subscribe_in.total_episode != subscribe.total_episode:
subscribe_dict["manual_total_episode"] = 1
# 总集数增加时,缺失集数也要增加
if subscribe_in.total_episode > (subscribe.total_episode or 0):
subscribe_dict["lack_episode"] = (subscribe.lack_episode

View File

@@ -741,7 +741,7 @@ class SubscribeChain(ChainBase):
continue
# 对于电视剧,获取当前季的总集数
episodes = mediainfo.seasons.get(subscribe.season) or []
if len(episodes):
if not subscribe.manual_total_episode and len(episodes):
total_episode = len(episodes)
lack_episode = subscribe.lack_episode + (total_episode - subscribe.total_episode)
logger.info(

View File

@@ -69,6 +69,8 @@ class Subscribe(Base):
save_path = Column(String)
# 是否使用 imdbid 搜索
search_imdbid = Column(Integer, default=0)
# 是否手动修改过总集数 0否 1是
manual_total_episode = Column(Integer, default=0)
@staticmethod
@db_query