fix 优化推荐跳转

feat 消息落库
This commit is contained in:
jxxghp
2024-03-14 19:15:13 +08:00
parent f50c2e59a9
commit c755dc9b85
8 changed files with 127 additions and 24 deletions

View File

@ -67,7 +67,11 @@ class TheMovieDbModule(_ModuleBase):
:param cache: 是否使用缓存
:return: 识别的媒体信息,包括剧集信息
"""
if settings.RECOGNIZE_SOURCE != "themoviedb":
if not tmdbid and not meta:
return None
if meta and not tmdbid \
and settings.RECOGNIZE_SOURCE != "themoviedb":
return None
if not meta:
@ -182,7 +186,7 @@ class TheMovieDbModule(_ModuleBase):
:param season: 季号
"""
# 搜索
logger.info(f"开始使用 名称:{name}年份:{year} 匹配TMDB信息 ...")
logger.info(f"开始使用 名称:{name} 年份:{year} 匹配TMDB信息 ...")
info = self.tmdb.match(name=name,
year=year,
mtype=mtype,

View File

@ -189,9 +189,16 @@ class TmdbHelper:
season_year,
season_number)
if not info:
logger.debug(
f"正在识别{mtype.value}{name}, 年份={year} ...")
info = self.__search_tv_by_name(name, year)
year_range = [year]
if year:
year_range.append(str(int(year) + 1))
year_range.append(str(int(year) - 1))
for year in year_range:
logger.debug(
f"正在识别{mtype.value}{name}, 年份={year} ...")
info = self.__search_tv_by_name(name, year)
if info:
break
if info:
info['media_type'] = MediaType.TV
# 返回