mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-28 19:47:41 +08:00
refactor: route startup and cli settings through runtime
This commit is contained in:
+4
-1
@@ -15,7 +15,10 @@ from urllib.request import ProxyHandler, Request, build_opener, urlopen
|
||||
import click
|
||||
import psutil
|
||||
|
||||
from app.runtime.config import Settings, settings
|
||||
from app.runtime.config import Settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.runtime.state import SystemHelper
|
||||
from app.application.backup import BackupArtifact
|
||||
from app.startup.database import build_database_governance
|
||||
|
||||
@@ -20,7 +20,9 @@ import psutil
|
||||
|
||||
from app.adapters.system.backup.database import verify_database_backup
|
||||
from app.adapters.system.backup.files import BackupFiles
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.runtime.topology import process_topology_issue
|
||||
from app.doctor.models import DoctorFinding, DoctorFindingStatus, DoctorReport, DoctorSeverity
|
||||
from app.adapters.system.host import SystemUtils
|
||||
|
||||
@@ -6,7 +6,9 @@ import sys
|
||||
from datetime import datetime
|
||||
from typing import Any, Optional
|
||||
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.doctor.checks import default_checks
|
||||
from app.doctor.models import (
|
||||
DoctorFinding,
|
||||
|
||||
+3
-1
@@ -21,7 +21,9 @@ from app.adapters.web.security.access import (
|
||||
)
|
||||
from app.application.security.token import create_access_token, decode_access_token
|
||||
from app.runtime.extensions.plugin_manager import PluginManager
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.runtime.correlation import get_correlation_id
|
||||
from app.runtime.localization import LocaleHelper
|
||||
from app.runtime.log import configure_correlation_id_provider, logger
|
||||
|
||||
+4
-1
@@ -55,7 +55,10 @@ elif SystemUtils.is_frozen():
|
||||
sys.stderr = open(os.devnull, 'w')
|
||||
|
||||
from app.factory import app
|
||||
from app.runtime.config import global_vars, settings
|
||||
from app.runtime.config import global_vars
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.runtime.topology import (
|
||||
UnsupportedProcessTopologyError,
|
||||
validate_process_topology,
|
||||
|
||||
@@ -1070,6 +1070,8 @@ QQ、Telegram、WeChat、WeChatClawBot 与字幕模块切换到动态运行时
|
||||
配置债务由 39 个文件降至 34 个,消息与字幕专项测试通过。
|
||||
TMDB、TVDB 与 TriMedia 模块切换到动态运行时配置,缓存、重试、媒体源和登录兼容行为保持;配置债务由 34 个
|
||||
文件降至 24 个,TMDB、媒体源与 TriMedia 专项测试通过。
|
||||
Doctor、factory、main 与 CLI 的部署读取切换到动态运行时端口,CLI 仍保留 `Settings` 类型清单和旧命令 ABI;
|
||||
配置债务由 24 个文件降至 19 个,Doctor、启动、CLI 与数据库迁移专项测试通过。
|
||||
|
||||
同日修正适配器配置下沉边界:OCR、CookieCloud、DoH、Rust 和资源签名等低层实现不再直接依赖
|
||||
`app.application`,由 `app.runtime.settings` 端口承接组合根注入;未启动装配时仍回退旧 Settings ABI,
|
||||
|
||||
@@ -9,17 +9,12 @@
|
||||
"root": "app"
|
||||
},
|
||||
"settings_imports": {
|
||||
"count": 24,
|
||||
"count": 19,
|
||||
"files": [
|
||||
"app/adapters/system/fsproxy.py",
|
||||
"app/cli.py",
|
||||
"app/db/base.py",
|
||||
"app/db/engine.py",
|
||||
"app/db/session.py",
|
||||
"app/doctor/checks.py",
|
||||
"app/doctor/runner.py",
|
||||
"app/factory.py",
|
||||
"app/main.py",
|
||||
"app/modules/filemanager/storages/local.py",
|
||||
"app/modules/postgresql/__init__.py",
|
||||
"app/modules/qbittorrent/__init__.py",
|
||||
|
||||
+7
-5
@@ -13,8 +13,8 @@
|
||||
"runtime_to_db": [],
|
||||
"workflow_to_db": []
|
||||
},
|
||||
"edge_count": 6425,
|
||||
"edge_sha256": "4d0424aeaa643346981710c4533b4cf546cf07a0d1cb9642707369c60afc4e39",
|
||||
"edge_count": 6427,
|
||||
"edge_sha256": "1d56d5da4d473e3c61cb5501b79619b9ec8a6623c788f629c31efac6972ce948",
|
||||
"edges": [
|
||||
"app -> app.runtime",
|
||||
"app -> app.runtime.compat",
|
||||
@@ -3413,6 +3413,7 @@
|
||||
"app.cli -> app.doctor.formatters",
|
||||
"app.cli -> app.runtime",
|
||||
"app.cli -> app.runtime.config",
|
||||
"app.cli -> app.runtime.settings",
|
||||
"app.cli -> app.runtime.state",
|
||||
"app.cli -> app.startup",
|
||||
"app.cli -> app.startup.database",
|
||||
@@ -3691,7 +3692,7 @@
|
||||
"app.doctor.checks -> app.doctor",
|
||||
"app.doctor.checks -> app.doctor.models",
|
||||
"app.doctor.checks -> app.runtime",
|
||||
"app.doctor.checks -> app.runtime.config",
|
||||
"app.doctor.checks -> app.runtime.settings",
|
||||
"app.doctor.checks -> app.runtime.topology",
|
||||
"app.doctor.formatters -> app.doctor",
|
||||
"app.doctor.formatters -> app.doctor.models",
|
||||
@@ -3702,7 +3703,7 @@
|
||||
"app.doctor.runner -> app.doctor.checks",
|
||||
"app.doctor.runner -> app.doctor.models",
|
||||
"app.doctor.runner -> app.runtime",
|
||||
"app.doctor.runner -> app.runtime.config",
|
||||
"app.doctor.runner -> app.runtime.settings",
|
||||
"app.domain.context -> app.domain",
|
||||
"app.domain.context -> app.domain.meta",
|
||||
"app.domain.context -> app.domain.meta.metabase",
|
||||
@@ -3810,13 +3811,13 @@
|
||||
"app.factory -> app.application.security",
|
||||
"app.factory -> app.application.security.token",
|
||||
"app.factory -> app.runtime",
|
||||
"app.factory -> app.runtime.config",
|
||||
"app.factory -> app.runtime.correlation",
|
||||
"app.factory -> app.runtime.extensions",
|
||||
"app.factory -> app.runtime.extensions.plugin_manager",
|
||||
"app.factory -> app.runtime.localization",
|
||||
"app.factory -> app.runtime.log",
|
||||
"app.factory -> app.runtime.observability",
|
||||
"app.factory -> app.runtime.settings",
|
||||
"app.factory -> app.schemas",
|
||||
"app.factory -> app.schemas.mcp",
|
||||
"app.factory -> app.schemas.openai",
|
||||
@@ -3830,6 +3831,7 @@
|
||||
"app.main -> app.factory",
|
||||
"app.main -> app.runtime",
|
||||
"app.main -> app.runtime.config",
|
||||
"app.main -> app.runtime.settings",
|
||||
"app.main -> app.runtime.topology",
|
||||
"app.modules -> app.runtime",
|
||||
"app.modules -> app.runtime.extensions",
|
||||
|
||||
Reference in New Issue
Block a user