fix bug
This commit is contained in:
@ -95,7 +95,11 @@ def update_subscribe(
|
|||||||
return schemas.Response(success=False, message="订阅不存在")
|
return schemas.Response(success=False, message="订阅不存在")
|
||||||
if subscribe_in.sites:
|
if subscribe_in.sites:
|
||||||
subscribe_in.sites = json.dumps(subscribe_in.sites)
|
subscribe_in.sites = json.dumps(subscribe_in.sites)
|
||||||
subscribe.update(db, subscribe_in.dict())
|
# 避免更新缺失集数
|
||||||
|
subscribe_dict = subscribe_in.dict()
|
||||||
|
if not subscribe_in.lack_episode:
|
||||||
|
subscribe_dict.pop("lack_episode")
|
||||||
|
subscribe.update(db, subscribe_dict)
|
||||||
return schemas.Response(success=True)
|
return schemas.Response(success=True)
|
||||||
|
|
||||||
|
|
||||||
|
@ -104,8 +104,16 @@ class TransferChain(ChainBase):
|
|||||||
# 查询下载记录识别情况
|
# 查询下载记录识别情况
|
||||||
downloadhis: DownloadHistory = self.downloadhis.get_by_hash(torrent.hash)
|
downloadhis: DownloadHistory = self.downloadhis.get_by_hash(torrent.hash)
|
||||||
if downloadhis:
|
if downloadhis:
|
||||||
mtype = MediaType.TV if downloadhis.type == MediaType.TV.value else MediaType.MOVIE
|
# 类型
|
||||||
mediainfo = self.recognize_media(mtype=mtype, tmdbid=downloadhis.tmdbid)
|
mtype = MediaType(downloadhis.type)
|
||||||
|
# 补充剧集信息
|
||||||
|
if mtype == MediaType.TV \
|
||||||
|
and ((not meta.season_list and downloadhis.seasons)
|
||||||
|
or (not meta.episode_list and downloadhis.episodes)):
|
||||||
|
meta = MetaInfo(f"{title} {downloadhis.seasons} {downloadhis.episodes}")
|
||||||
|
# 按TMDBID识别
|
||||||
|
mediainfo = self.recognize_media(mtype=mtype,
|
||||||
|
tmdbid=downloadhis.tmdbid)
|
||||||
else:
|
else:
|
||||||
# 使用标题识别媒体信息
|
# 使用标题识别媒体信息
|
||||||
mediainfo: MediaInfo = self.recognize_media(meta=meta)
|
mediainfo: MediaInfo = self.recognize_media(meta=meta)
|
||||||
|
@ -22,7 +22,7 @@ class DownloadHistory(Base):
|
|||||||
tvdbid = Column(Integer)
|
tvdbid = Column(Integer)
|
||||||
doubanid = Column(String)
|
doubanid = Column(String)
|
||||||
# Sxx
|
# Sxx
|
||||||
seasons = Column(Integer)
|
seasons = Column(String)
|
||||||
# Exx
|
# Exx
|
||||||
episodes = Column(String)
|
episodes = Column(String)
|
||||||
# 海报
|
# 海报
|
||||||
|
Reference in New Issue
Block a user