mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-05-16 13:55:28 +08:00
fix(tmdbapi): 修复按季搜索剧集的名称匹配逻辑问题
This commit is contained in:
@@ -643,17 +643,23 @@ class TmdbApi:
|
|||||||
reverse=True
|
reverse=True
|
||||||
)
|
)
|
||||||
for tv in tvs:
|
for tv in tvs:
|
||||||
# 年份
|
# 使用年份、名称匹配
|
||||||
tv_year = tv.get('first_air_date')[0:4] if tv.get('first_air_date') else None
|
tv_year = tv.get('first_air_date')[0:4] if tv.get('first_air_date') else None
|
||||||
if (self.__compare_names(name, tv.get('name'))
|
if (self.__compare_names(name, tv.get('name'))
|
||||||
or self.__compare_names(name, tv.get('original_name'))) \
|
or self.__compare_names(name, tv.get('original_name'))) \
|
||||||
and (tv_year == str(season_year)):
|
and (tv_year == str(season_year)):
|
||||||
return tv
|
return tv
|
||||||
# 匹配别名、译名
|
# 获取别名、译名重新匹配
|
||||||
if not tv.get("names"):
|
if not tv.get("names"):
|
||||||
tv = self.get_info(mtype=MediaType.TV, tmdbid=tv.get("id"))
|
tv = self.get_info(mtype=MediaType.TV, tmdbid=tv.get("id"))
|
||||||
if not tv or not self.__compare_names(name, tv.get("names")):
|
if not tv or not (
|
||||||
|
self.__compare_names(name, tv.get("name"))
|
||||||
|
or self.__compare_names(name, tv.get("original_name"))
|
||||||
|
or self.__compare_names(name, tv.get("names"))):
|
||||||
continue
|
continue
|
||||||
|
if tv_year == str(season_year):
|
||||||
|
return tv
|
||||||
|
# 季年份匹配
|
||||||
if __season_match(tv_info=tv, _season_year=season_year):
|
if __season_match(tv_info=tv, _season_year=season_year):
|
||||||
return tv
|
return tv
|
||||||
return {}
|
return {}
|
||||||
|
|||||||
Reference in New Issue
Block a user