mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-06 07:56:52 +08:00
Fix: TMDB 剧集详情页不显示第 0 季(特别篇) #5444
This commit is contained in:
@@ -101,7 +101,7 @@ def not_exists(media_in: schemas.MediaInfo,
|
|||||||
mtype = MediaType(media_in.type) if media_in.type else None
|
mtype = MediaType(media_in.type) if media_in.type else None
|
||||||
if mtype:
|
if mtype:
|
||||||
meta.type = mtype
|
meta.type = mtype
|
||||||
if media_in.season:
|
if media_in.season is not None:
|
||||||
meta.begin_season = media_in.season
|
meta.begin_season = media_in.season
|
||||||
meta.type = MediaType.TV
|
meta.type = MediaType.TV
|
||||||
if media_in.year:
|
if media_in.year:
|
||||||
|
|||||||
+1
-1
@@ -465,7 +465,7 @@ class MediaInfo:
|
|||||||
for seainfo in info.get('seasons'):
|
for seainfo in info.get('seasons'):
|
||||||
# 季
|
# 季
|
||||||
season = seainfo.get("season_number")
|
season = seainfo.get("season_number")
|
||||||
if not season:
|
if season is None:
|
||||||
continue
|
continue
|
||||||
# 集
|
# 集
|
||||||
episode_count = seainfo.get("episode_count")
|
episode_count = seainfo.get("episode_count")
|
||||||
|
|||||||
@@ -798,7 +798,7 @@ class TheMovieDbModule(_ModuleBase):
|
|||||||
if not tmdb_info:
|
if not tmdb_info:
|
||||||
return []
|
return []
|
||||||
return [schemas.TmdbSeason(**sea)
|
return [schemas.TmdbSeason(**sea)
|
||||||
for sea in tmdb_info.get("seasons", []) if sea.get("season_number")]
|
for sea in tmdb_info.get("seasons", []) if sea.get("season_number") is not None]
|
||||||
|
|
||||||
def tmdb_group_seasons(self, group_id: str) -> List[schemas.TmdbSeason]:
|
def tmdb_group_seasons(self, group_id: str) -> List[schemas.TmdbSeason]:
|
||||||
"""
|
"""
|
||||||
@@ -1168,7 +1168,7 @@ class TheMovieDbModule(_ModuleBase):
|
|||||||
if not tmdb_info:
|
if not tmdb_info:
|
||||||
return []
|
return []
|
||||||
return [schemas.TmdbSeason(**sea)
|
return [schemas.TmdbSeason(**sea)
|
||||||
for sea in tmdb_info.get("seasons", []) if sea.get("season_number")]
|
for sea in tmdb_info.get("seasons", []) if sea.get("season_number") is not None]
|
||||||
|
|
||||||
async def async_tmdb_group_seasons(self, group_id: str) -> List[schemas.TmdbSeason]:
|
async def async_tmdb_group_seasons(self, group_id: str) -> List[schemas.TmdbSeason]:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ class TmdbApi:
|
|||||||
"""
|
"""
|
||||||
记录匹配调试日志
|
记录匹配调试日志
|
||||||
"""
|
"""
|
||||||
if season_number and season_year:
|
if season_number is not None and season_year:
|
||||||
logger.debug(f"正在识别{mtype.value}:{name}, 季集={season_number}, 季集年份={season_year} ...")
|
logger.debug(f"正在识别{mtype.value}:{name}, 季集={season_number}, 季集年份={season_year} ...")
|
||||||
else:
|
else:
|
||||||
logger.debug(f"正在识别{mtype.value}:{name}, 年份={year} ...")
|
logger.debug(f"正在识别{mtype.value}:{name}, 年份={year} ...")
|
||||||
@@ -473,7 +473,7 @@ class TmdbApi:
|
|||||||
info = self._set_media_type(info, MediaType.MOVIE)
|
info = self._set_media_type(info, MediaType.MOVIE)
|
||||||
else:
|
else:
|
||||||
# 有当前季和当前季集年份,使用精确匹配
|
# 有当前季和当前季集年份,使用精确匹配
|
||||||
if season_year and season_number:
|
if season_year and season_number is not None:
|
||||||
self._log_match_debug(mtype, name, season_year, season_number, season_year)
|
self._log_match_debug(mtype, name, season_year, season_number, season_year)
|
||||||
info = self.__search_tv_by_season(name,
|
info = self.__search_tv_by_season(name,
|
||||||
season_year,
|
season_year,
|
||||||
@@ -697,7 +697,7 @@ class TmdbApi:
|
|||||||
return {}
|
return {}
|
||||||
ret_seasons = {}
|
ret_seasons = {}
|
||||||
for season_info in tv_info.get("seasons") or []:
|
for season_info in tv_info.get("seasons") or []:
|
||||||
if not season_info.get("season_number"):
|
if season_info.get("season_number") is None:
|
||||||
continue
|
continue
|
||||||
ret_seasons[season_info.get("season_number")] = season_info
|
ret_seasons[season_info.get("season_number")] = season_info
|
||||||
return ret_seasons
|
return ret_seasons
|
||||||
@@ -2028,7 +2028,7 @@ class TmdbApi:
|
|||||||
info = self._set_media_type(info, MediaType.MOVIE)
|
info = self._set_media_type(info, MediaType.MOVIE)
|
||||||
else:
|
else:
|
||||||
# 有当前季和当前季集年份,使用精确匹配
|
# 有当前季和当前季集年份,使用精确匹配
|
||||||
if season_year and season_number:
|
if season_year and season_number is not None:
|
||||||
self._log_match_debug(mtype, name, season_year, season_number, season_year)
|
self._log_match_debug(mtype, name, season_year, season_number, season_year)
|
||||||
info = await self.__async_search_tv_by_season(name,
|
info = await self.__async_search_tv_by_season(name,
|
||||||
season_year,
|
season_year,
|
||||||
|
|||||||
Reference in New Issue
Block a user