refactor: add dynamic runtime settings compatibility proxy

This commit is contained in:
jxxghp
2026-08-23 02:16:03 +08:00
parent de85ae3ef9
commit ef6a613eb3
7 changed files with 41 additions and 12 deletions
+3 -1
View File
@@ -30,7 +30,7 @@ from importlib.metadata import distributions
from requests import Response
from app.runtime.cache import cached, is_fresh
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
from app.adapters.system.package import (
PackageInstallRequest,
build_package_install_strategies,
@@ -52,6 +52,8 @@ from app.adapters.system.host import SystemUtils
from app.foundation.url import UrlUtils
from version import APP_VERSION
# 保留模块级可替换入口,代理默认读取组合根的最新 runtime 配置。
settings = RuntimeSettingsCompat()
PLUGIN_DIR = Path(settings.ROOT_PATH) / "app" / "plugins"
LOCAL_REPO_PREFIX = "local://"
PLUGIN_SYSTEM_VERSION_FIELD = "system_version"
+5 -1
View File
@@ -6,7 +6,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union
from urllib.parse import parse_qs, quote, urlparse, urlsplit
from app.runtime.cache import cached
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
from app.domain.context import MediaInfo, MusicInfo
from app.domain.meta.metabase import MetaBase
from app.runtime.log import logger
@@ -24,6 +24,10 @@ from app.adapters.system.host import SystemUtils
from version import APP_VERSION, FRONTEND_VERSION
# 保留旧插件可覆盖的模块级入口,默认通过 runtime 代理动态读取配置。
settings = RuntimeSettingsCompat()
_server_report_service: Any = None
_server_sharing_service: Any = None