Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp committed Nov 3, 2024
1 parent df8531e commit 0584bda
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/chain/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def process(self, mediainfo: MediaInfo,
:param rule_groups: 过滤规则组名称列表
:param area: 搜索范围,title or imdbid
:param custom_words: 自定义识别词列表
:param filter_params: 过滤参数
"""

def __do_filter(torrent_list: List[TorrentInfo]) -> List[TorrentInfo]:
Expand Down
4 changes: 3 additions & 1 deletion app/modules/douban/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ def recognize_media(self, meta: MetaBase = None,
info = self.douban_info(doubanid=doubanid, mtype=mtype or meta.type)
elif meta:
info = {}
# 简体名称
zh_name = zhconv.convert(meta.cn_name, "zh-hans") if meta.cn_name else None
# 使用中英文名分别识别,去重去空,但要保持顺序
names = list(dict.fromkeys([k for k in [meta.cn_name, zhconv.convert(meta.cn_name, "zh-hans"), meta.en_name] if k]))
names = list(dict.fromkeys([k for k in [meta.cn_name, zh_name, meta.en_name] if k]))
for name in names:
if meta.begin_season:
logger.info(f"正在识别 {name}{meta.begin_season}季 ...")
Expand Down
4 changes: 3 additions & 1 deletion app/modules/themoviedb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ def recognize_media(self, meta: MetaBase = None,
info = self.tmdb.get_info(mtype=mtype, tmdbid=tmdbid)
elif meta:
info = {}
# 简体名称
zh_name = zhconv.convert(meta.cn_name, "zh-hans") if meta.cn_name else None
# 使用中英文名分别识别,去重去空,但要保持顺序
names = list(dict.fromkeys([k for k in [meta.cn_name, zhconv.convert(meta.cn_name, "zh-hans"), meta.en_name] if k]))
names = list(dict.fromkeys([k for k in [meta.cn_name, zh_name, meta.en_name] if k]))
for name in names:
if meta.begin_season:
logger.info(f"正在识别 {name}{meta.begin_season}季 ...")
Expand Down

0 comments on commit 0584bda

Please sign in to comment.