mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-11-22 03:43:45 +08:00
Run `ruff check app tests scripts --fix` with the configured rule set (E4/E7/E9/F/I): import sorting (I001), f-strings without placeholders (F541), lambda/variable/unused-import cleanups that ruff marks safe. Nine files whose only ruff debt sits next to pre-existing pylint import-resolution errors (lazy exports, sys.path script imports) or whose "unused" imports are reached through attribute access by tests are left untouched so the changed-file pylint gate and the benchmark tests stay green; their diagnostics remain in the baseline. app/startup/lifecycle/__init__.py and app/main.py import business modules after cache composition, import-path and stdio setup on purpose (the source comments document the contract), so declare E402 per-file-ignores for them instead of adding per-line noqa. Ruff ratchet watermark drops from 498 to 100; sync the baseline fixture and the optimization checklist figure. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
79 lines
2.1 KiB
Python
79 lines
2.1 KiB
Python
"""插件使用的媒体上下文、歌词候选、标题解析、识别类型和媒体身份规则。"""
|
|
|
|
from app.domain.context import Context, MediaInfo, MusicInfo, MusicLyrics, TorrentInfo
|
|
from app.domain.media import (
|
|
MUSIC_MEDIA_SOURCE_ORDER,
|
|
MUSIC_MEDIA_SOURCES,
|
|
configure_search_source_provider,
|
|
is_media_source_enabled,
|
|
is_media_source_selected,
|
|
is_music_media_source,
|
|
normalize_music_type,
|
|
parse_media_source_selection,
|
|
)
|
|
from app.domain.meta.customization import set_custom_separator
|
|
from app.domain.meta.metaanime import MetaAnime
|
|
from app.domain.meta.metabase import MetaBase
|
|
from app.domain.meta.metamusic import (
|
|
MetaMusic,
|
|
MusicNameContext,
|
|
MusicNameParser,
|
|
MusicNameParseResult,
|
|
MusicNamePattern,
|
|
MusicNamePatternMatch,
|
|
MusicNameRegistry,
|
|
)
|
|
from app.domain.meta.metavideo import MetaVideo
|
|
from app.domain.meta.words import WordsMatcher
|
|
from app.domain.metainfo import MetaInfo, MetaInfoPath
|
|
from app.domain.scraper import NfoReader
|
|
from app.domain.tokens import Tokens
|
|
from app.schemas.media import (
|
|
MEDIA_SOURCE_ALIASES,
|
|
MEDIA_SOURCE_PREFIXES,
|
|
build_media_key,
|
|
normalize_media_identity_payload,
|
|
normalize_media_source,
|
|
parse_media_key,
|
|
resolve_media_identity,
|
|
)
|
|
|
|
__all__ = [
|
|
"Context",
|
|
"MEDIA_SOURCE_ALIASES",
|
|
"MEDIA_SOURCE_PREFIXES",
|
|
"MUSIC_MEDIA_SOURCE_ORDER",
|
|
"MUSIC_MEDIA_SOURCES",
|
|
"MediaInfo",
|
|
"MetaAnime",
|
|
"MetaBase",
|
|
"MetaInfo",
|
|
"MetaInfoPath",
|
|
"MetaMusic",
|
|
"MetaVideo",
|
|
"MusicInfo",
|
|
"MusicLyrics",
|
|
"NfoReader",
|
|
"Tokens",
|
|
"MusicNameContext",
|
|
"MusicNameParseResult",
|
|
"MusicNameParser",
|
|
"MusicNamePattern",
|
|
"MusicNamePatternMatch",
|
|
"MusicNameRegistry",
|
|
"TorrentInfo",
|
|
"WordsMatcher",
|
|
"build_media_key",
|
|
"configure_search_source_provider",
|
|
"is_media_source_enabled",
|
|
"is_media_source_selected",
|
|
"is_music_media_source",
|
|
"normalize_media_identity_payload",
|
|
"normalize_media_source",
|
|
"normalize_music_type",
|
|
"parse_media_key",
|
|
"parse_media_source_selection",
|
|
"resolve_media_identity",
|
|
"set_custom_separator",
|
|
]
|