mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-29 12:06:51 +08:00
refactor: route storage adapter settings through runtime
This commit is contained in:
@@ -27,7 +27,9 @@ import threading
|
||||
from pathlib import Path
|
||||
from typing import Any, Callable, Dict, List, Optional
|
||||
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.runtime.log import logger
|
||||
|
||||
# worker 脚本路径。用绝对路径直接执行,而不是 -m 或 import:
|
||||
|
||||
@@ -6,7 +6,10 @@ from typing import Optional, List
|
||||
|
||||
from app.schemas.file import StorageUsage as _SchemaStorageUsage
|
||||
from app.schemas.workflow import FileItem as _SchemaFileItem
|
||||
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.application.directory import DirectoryHelper
|
||||
from app.runtime.log import logger
|
||||
from app.adapters.system.fsproxy import fsproxy
|
||||
|
||||
@@ -3,7 +3,10 @@ from typing import Union, Tuple
|
||||
|
||||
from pywebpush import webpush, WebPushException
|
||||
|
||||
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.log import logger
|
||||
from app.modules import _ModuleBase, _MessageBase
|
||||
from app.schemas.message import Message
|
||||
|
||||
@@ -13,7 +13,9 @@ from app.runtime.capabilities.model import (
|
||||
SelectorSchema,
|
||||
)
|
||||
from app.runtime.capabilities.registry import CapabilityRegistry
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.runtime.extensions.service_config import ServiceConfigHelper
|
||||
from app.schemas.types import (
|
||||
DownloaderType,
|
||||
|
||||
@@ -1072,6 +1072,8 @@ TMDB、TVDB 与 TriMedia 模块切换到动态运行时配置,缓存、重试
|
||||
文件降至 24 个,TMDB、媒体源与 TriMedia 专项测试通过。
|
||||
Doctor、factory、main 与 CLI 的部署读取切换到动态运行时端口,CLI 仍保留 `Settings` 类型清单和旧命令 ABI;
|
||||
配置债务由 24 个文件降至 19 个,Doctor、启动、CLI 与数据库迁移专项测试通过。
|
||||
FS proxy、Local/WebPush 存储适配以及 Module host adapter 切换到动态运行时端口,保留 global_vars、能力
|
||||
快照与模块契约行为;配置债务由 19 个文件降至 15 个,文件存储、WebPush 与 Module contract 专项测试通过。
|
||||
|
||||
同日修正适配器配置下沉边界:OCR、CookieCloud、DoH、Rust 和资源签名等低层实现不再直接依赖
|
||||
`app.application`,由 `app.runtime.settings` 端口承接组合根注入;未启动装配时仍回退旧 Settings ABI,
|
||||
|
||||
@@ -9,20 +9,16 @@
|
||||
"root": "app"
|
||||
},
|
||||
"settings_imports": {
|
||||
"count": 19,
|
||||
"count": 15,
|
||||
"files": [
|
||||
"app/adapters/system/fsproxy.py",
|
||||
"app/db/base.py",
|
||||
"app/db/engine.py",
|
||||
"app/db/session.py",
|
||||
"app/modules/filemanager/storages/local.py",
|
||||
"app/modules/postgresql/__init__.py",
|
||||
"app/modules/qbittorrent/__init__.py",
|
||||
"app/modules/redis/__init__.py",
|
||||
"app/modules/rtorrent/__init__.py",
|
||||
"app/modules/transmission/__init__.py",
|
||||
"app/modules/webpush/__init__.py",
|
||||
"app/runtime/extensions/host_module_adapter.py",
|
||||
"app/startup/agent_initializer.py",
|
||||
"app/startup/database.py",
|
||||
"app/startup/database_initializer.py",
|
||||
|
||||
+6
-4
@@ -13,8 +13,8 @@
|
||||
"runtime_to_db": [],
|
||||
"workflow_to_db": []
|
||||
},
|
||||
"edge_count": 6427,
|
||||
"edge_sha256": "1d56d5da4d473e3c61cb5501b79619b9ec8a6623c788f629c31efac6972ce948",
|
||||
"edge_count": 6429,
|
||||
"edge_sha256": "268e9cedacc3d2a4e25e153b25e4c43784da83d77fd339936d3a0d7cb3f8ced3",
|
||||
"edges": [
|
||||
"app -> app.runtime",
|
||||
"app -> app.runtime.compat",
|
||||
@@ -123,8 +123,8 @@
|
||||
"app.adapters.system.display.resource -> app.runtime",
|
||||
"app.adapters.system.display.resource -> app.runtime.log",
|
||||
"app.adapters.system.fsproxy -> app.runtime",
|
||||
"app.adapters.system.fsproxy -> app.runtime.config",
|
||||
"app.adapters.system.fsproxy -> app.runtime.log",
|
||||
"app.adapters.system.fsproxy -> app.runtime.settings",
|
||||
"app.adapters.system.host -> app.foundation",
|
||||
"app.adapters.system.host -> app.foundation.environment",
|
||||
"app.adapters.system.host -> app.schemas",
|
||||
@@ -4173,6 +4173,7 @@
|
||||
"app.modules.filemanager.storages.local -> app.runtime",
|
||||
"app.modules.filemanager.storages.local -> app.runtime.config",
|
||||
"app.modules.filemanager.storages.local -> app.runtime.log",
|
||||
"app.modules.filemanager.storages.local -> app.runtime.settings",
|
||||
"app.modules.filemanager.storages.local -> app.schemas",
|
||||
"app.modules.filemanager.storages.local -> app.schemas.exception",
|
||||
"app.modules.filemanager.storages.local -> app.schemas.file",
|
||||
@@ -5276,6 +5277,7 @@
|
||||
"app.modules.webpush -> app.runtime",
|
||||
"app.modules.webpush -> app.runtime.config",
|
||||
"app.modules.webpush -> app.runtime.log",
|
||||
"app.modules.webpush -> app.runtime.settings",
|
||||
"app.modules.webpush -> app.schemas",
|
||||
"app.modules.webpush -> app.schemas.message",
|
||||
"app.modules.webpush -> app.schemas.types",
|
||||
@@ -5519,9 +5521,9 @@
|
||||
"app.runtime.extensions.host_module_adapter -> app.runtime.capabilities",
|
||||
"app.runtime.extensions.host_module_adapter -> app.runtime.capabilities.model",
|
||||
"app.runtime.extensions.host_module_adapter -> app.runtime.capabilities.registry",
|
||||
"app.runtime.extensions.host_module_adapter -> app.runtime.config",
|
||||
"app.runtime.extensions.host_module_adapter -> app.runtime.extensions",
|
||||
"app.runtime.extensions.host_module_adapter -> app.runtime.extensions.service_config",
|
||||
"app.runtime.extensions.host_module_adapter -> app.runtime.settings",
|
||||
"app.runtime.extensions.host_module_adapter -> app.schemas",
|
||||
"app.runtime.extensions.host_module_adapter -> app.schemas.types",
|
||||
"app.runtime.extensions.managed_resource_adapter -> app.runtime",
|
||||
|
||||
Reference in New Issue
Block a user