mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-04 15:09:46 +08:00
refactor(config): retire RuntimeSettingsCompat host usage
This commit is contained in:
@@ -20,7 +20,7 @@ from app.domain.meta.runtime import (
|
||||
)
|
||||
from app.domain.metainfo import MetaInfo, MetaInfoPath
|
||||
from app.adapters.system import rust as rust_accel
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
from app.runtime.settings import get_runtime_setting
|
||||
from tests.cases.meta import meta_cases
|
||||
|
||||
|
||||
@@ -64,14 +64,13 @@ _MUSIC_CASES: tuple[BenchmarkInput, ...] = (
|
||||
|
||||
def configure_benchmark_runtime() -> None:
|
||||
"""注入独立基准所需的文件类型和 Rust 适配器,避免静默测量 Python 回退。"""
|
||||
settings = RuntimeSettingsCompat()
|
||||
configure_recognition_runtime(
|
||||
media_extensions_provider=lambda: (
|
||||
*settings.RMT_MEDIAEXT,
|
||||
*settings.RMT_SUBEXT,
|
||||
*settings.RMT_AUDIOEXT,
|
||||
*get_runtime_setting("RMT_MEDIAEXT"),
|
||||
*get_runtime_setting("RMT_SUBEXT"),
|
||||
*get_runtime_setting("RMT_AUDIOEXT"),
|
||||
),
|
||||
audio_extensions_provider=lambda: settings.RMT_AUDIOEXT,
|
||||
audio_extensions_provider=lambda: get_runtime_setting("RMT_AUDIOEXT"),
|
||||
accelerator=rust_accel,
|
||||
)
|
||||
|
||||
|
||||
@@ -104,6 +104,7 @@ from app.testing.bootstrap import ensure_sites_stub
|
||||
|
||||
ensure_sites_stub()
|
||||
from app.startup import lifecycle
|
||||
from app.runtime.config import settings as legacy_settings
|
||||
|
||||
|
||||
def _noop():
|
||||
@@ -140,7 +141,7 @@ def _isolated_stop(component):
|
||||
|
||||
async def _probe():
|
||||
'''执行一次隔离生命周期并输出资源与耗时样本。'''
|
||||
lifecycle.settings.MOVIEPILOT_SAFE_MODE = {safe_mode!r}
|
||||
legacy_settings.MOVIEPILOT_SAFE_MODE = {safe_mode!r}
|
||||
lifecycle.init_extra = _async_noop
|
||||
lifecycle.global_vars.set_loop = lambda loop: None
|
||||
lifecycle.global_vars.stop_system = lambda: None
|
||||
|
||||
Reference in New Issue
Block a user