fix #267 电影年份匹配上下浮动1年

This commit is contained in:
jxxghp 2023-08-27 07:48:16 +08:00
parent f52deb3ff2
commit 4b91510695

View File

@ -189,14 +189,16 @@ class SearchChain(ChainBase):
# 比对年份 # 比对年份
if mediainfo.year: if mediainfo.year:
if mediainfo.type == MediaType.TV: if mediainfo.type == MediaType.TV:
# 需要剧集 # 剧集年份,每季的年份可能不同
if torrent_meta.year and torrent_meta.year not in [year for year in if torrent_meta.year and torrent_meta.year not in [year for year in
mediainfo.season_years.values()]: mediainfo.season_years.values()]:
logger.warn(f'{torrent.site_name} - {torrent.title} 年份不匹配') logger.warn(f'{torrent.site_name} - {torrent.title} 年份不匹配')
continue continue
else: else:
# 需要电影 # 电影年份上下浮动1年
if torrent_meta.year != mediainfo.year: if torrent_meta.year not in [str(int(mediainfo.year) - 1),
mediainfo.year,
str(int(mediainfo.year) + 1)]:
logger.warn(f'{torrent.site_name} - {torrent.title} 年份不匹配') logger.warn(f'{torrent.site_name} - {torrent.title} 年份不匹配')
continue continue
# 比对标题 # 比对标题