mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-22 08:43:37 +08:00
feat: 识别文件类型:音乐
This commit is contained in:
@@ -2,7 +2,7 @@ from typing import Any, Optional, Tuple, Union
|
||||
|
||||
from app.core.cache import cached
|
||||
from app.core.config import settings
|
||||
from app.core.music import MUSIC_ENTITY_ALBUM, MUSIC_ENTITY_RECORDING, MusicInfo
|
||||
from app.core.context import MUSIC_ENTITY_ALBUM, MUSIC_ENTITY_RECORDING, MusicInfo
|
||||
from app.log import logger
|
||||
from app.modules import _ModuleBase
|
||||
from app.schemas.types import ModuleType, OtherModulesType
|
||||
|
||||
@@ -4,14 +4,14 @@ from typing import Any, Optional, Tuple, Union
|
||||
|
||||
from app.core.cache import cached
|
||||
from app.core.config import settings
|
||||
from app.core.music import (
|
||||
from app.core.context import (
|
||||
MUSIC_ENTITY_ALBUM,
|
||||
MusicAlbumInfo,
|
||||
MusicArtistInfo,
|
||||
MusicInfo,
|
||||
MusicMeta,
|
||||
MusicRelease,
|
||||
)
|
||||
from app.core.meta import MetaMusic
|
||||
from app.log import logger
|
||||
from app.modules import _ModuleBase
|
||||
from app.schemas.types import MediaRecognizeType, ModuleType
|
||||
@@ -97,7 +97,7 @@ class MusicBrainzModule(_ModuleBase):
|
||||
"""返回音乐元数据模块执行优先级。"""
|
||||
return 5
|
||||
|
||||
def search_music(self, meta: MusicMeta, limit: int = 20) -> list[MusicInfo]:
|
||||
def search_music(self, meta: MetaMusic, limit: int = 20) -> list[MusicInfo]:
|
||||
"""根据标准音乐搜索条件返回 MusicBrainz 录音候选。"""
|
||||
query = self._build_query(meta)
|
||||
if not query:
|
||||
@@ -208,7 +208,7 @@ class MusicBrainzModule(_ModuleBase):
|
||||
return self._related_artists(payload.get("relations") or [], count=count)
|
||||
|
||||
@classmethod
|
||||
def _build_query(cls, meta: MusicMeta) -> str:
|
||||
def _build_query(cls, meta: MetaMusic) -> str:
|
||||
"""构造 MusicBrainz Recording 搜索表达式。"""
|
||||
clauses = []
|
||||
if meta.title:
|
||||
|
||||
Reference in New Issue
Block a user