From 4b915106952144cdacde6efe2c41ee68f5c3b6f9 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sun, 27 Aug 2023 07:48:16 +0800 Subject: [PATCH] =?UTF-8?q?fix=20#267=20=E7=94=B5=E5=BD=B1=E5=B9=B4?= =?UTF-8?q?=E4=BB=BD=E5=8C=B9=E9=85=8D=E4=B8=8A=E4=B8=8B=E6=B5=AE=E5=8A=A8?= =?UTF-8?q?1=E5=B9=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chain/search.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/chain/search.py b/app/chain/search.py index e1c30423..027894d2 100644 --- a/app/chain/search.py +++ b/app/chain/search.py @@ -189,14 +189,16 @@ class SearchChain(ChainBase): # 比对年份 if mediainfo.year: if mediainfo.type == MediaType.TV: - # 需要剧集 + # 剧集年份,每季的年份可能不同 if torrent_meta.year and torrent_meta.year not in [year for year in mediainfo.season_years.values()]: logger.warn(f'{torrent.site_name} - {torrent.title} 年份不匹配') continue else: - # 需要电影 - if torrent_meta.year != mediainfo.year: + # 电影年份,上下浮动1年 + 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} 年份不匹配') continue # 比对标题