fix(music): accept multi-file album release names

This commit is contained in:
jxxghp
2026-11-09 18:41:43 +08:00
parent 252d05767f
commit db0730f65f
3 changed files with 49 additions and 2 deletions

View File

@@ -128,6 +128,26 @@ def test_release_names_without_group_or_cjk_credit(title, artists):
assert (meta.title, meta.artists, meta.year, meta.audio_format) == ("Album", artists, 2022, "FLAC")
@pytest.mark.usefixtures("music_engine")
def test_multi_file_release_suffix_matches_album_main_title():
"""
分轨资源常用的 ``FLAC Multi File`` 尾标不应进入专辑标题,专辑副标题省略时仍应命中主标题。
"""
resource = "Various Artists - The Secret Life Of Walter Mitty 2013 - FLAC Multi File"
meta = MetaMusic.parse_resource(resource)
target = MusicInfo(
music_type="album",
title="The Secret Life of Walter Mitty: Music From and Inspired by the Motion Picture",
artists=["Various Artists"],
year=2013,
)
assert (meta.title, meta.year, meta.artists) == (
"The Secret Life Of Walter Mitty", 2013, ["Various Artists"],
)
assert match_music_resource(target, resource).status == "exact"
@pytest.mark.usefixtures("music_engine")
@pytest.mark.parametrize("title,expected,year", [
(