mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
fix(music): 尾部规格段剥离与书名号结构归因修复
- 新增 _strip_spec_segments 尾部纯规格段整段剥离,避免规格后缀把 艺术家/曲名拆分点推到连字符上(许茹芸 - 等得到 ... ALAC-HHWEB) - 段定位限定段内禁连字符,匹配落在最尾片段;发布组标签仅在 紧跟格式词的无空格形态或段内含规格词时剥离,保护单词曲名 - APE+CUE 联合写法的加号纳入规格段判定与悬空分隔符修剪 - 含书名号的括号注释(电影《xxx》主题曲)在结构解析前提取并拼回曲名, 单层括号消歧后缀(电影版)保留 - 书名号分支支持「曲名-歌手」艺术家段反向拆分与尾部碟号/年份提取 - MusicBrainz 候选弱匹配扩展冒号副标题与首段连字符,检索式剥离尾部年份 - 补充规格段/书名号/VA/场景点分等真实种子测试案例
This commit is contained in:
@@ -674,6 +674,23 @@ def test_select_album_candidate_matches_colon_subtitle():
|
||||
assert matched.media_id == "album-colon"
|
||||
|
||||
|
||||
def test_select_album_candidate_matches_head_title():
|
||||
"""条目「曲名-歌手《巡演名》」连字符前置命名应与资源曲名弱匹配命中。"""
|
||||
meta = MetaMusic(title="为你盛开", artists=["许巍"])
|
||||
album = MusicInfo(
|
||||
source="musicbrainz",
|
||||
music_type="album",
|
||||
media_id="album-head",
|
||||
title="为你盛开-许巍《无尽光芒》巡回演唱会现场纪念",
|
||||
artists=["许巍"],
|
||||
)
|
||||
|
||||
matched = MusicBrainzModule._select_album_candidate(meta, [album])
|
||||
|
||||
assert matched is not None
|
||||
assert matched.media_id == "album-head"
|
||||
|
||||
|
||||
def test_search_title_strips_trailing_year():
|
||||
"""检索式应剥离曲名尾部独立年份,避免年份文本造成精确短语零命中。"""
|
||||
assert MusicBrainzModule._search_title("Funky Jazz Saxophone 2024") == "Funky Jazz Saxophone"
|
||||
|
||||
Reference in New Issue
Block a user