fix(music): keep shared search signatures compatible

This commit is contained in:
jxxghp
2026-09-10 10:16:09 +08:00
parent 1af5b8f019
commit 554e7388b3
3 changed files with 22 additions and 4 deletions

View File

@@ -219,6 +219,18 @@ def test_theaudiodb_module_ignores_other_sources(monkeypatch):
request.assert_not_called()
@pytest.mark.parametrize("module_class", [DoubanModule, TheAudioDbModule])
def test_music_search_modules_accept_entity_filter_from_shared_dispatch(module_class):
"""共享模块调度器广播实体过滤参数时,各内置音乐来源都必须保持签名兼容。"""
module = module_class()
assert module.search_music(
MetaMusic(title="Yellow"),
media_source=MediaSource.MusicBrainz,
music_types=("recording", "album"),
) is None
def test_theaudiodb_title_only_search_skips_incomplete_track_and_album_requests(monkeypatch):
"""缺少艺术家时只搜索艺术家,避免请求会返回空正文的曲目和专辑接口。"""
module = TheAudioDbModule()