refactor: route media and chat module settings through runtime

This commit is contained in:
jxxghp
2026-08-23 03:09:59 +08:00
parent 4098cc1eec
commit ac32adc7b6
8 changed files with 24 additions and 17 deletions
+3 -1
View File
@@ -9,7 +9,9 @@ import discord
from discord import app_commands
import httpx
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.domain.context import MediaInfo, Context
from app.domain.metainfo import MetaInfo
from app.runtime.log import logger
+3 -1
View File
@@ -14,7 +14,9 @@ from app.schemas.mediaserver import MediaServerLibrary as _SchemaMediaServerLibr
from app.schemas.mediaserver import MediaServerPlayItem as _SchemaMediaServerPlayItem
from app.schemas.mediaserver import RefreshMediaItem as _SchemaRefreshMediaItem
from app.schemas.mediaserver import WebhookEventInfo as _SchemaWebhookEventInfo
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.application.mediaserver import MediaServerIdentityHelper, MusicMediaServerHelper
from app.runtime.log import logger
from app.schemas.mediaserver import MediaServerItem
+3 -1
View File
@@ -50,7 +50,9 @@ from lark_oapi.event.callback.model.p2_card_action_trigger import (
P2CardActionTriggerResponse,
)
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.domain.context import Context, MediaInfo
from app.application.security.user import get_configured_user_channel_lookup
from app.application.messaging.agent import matches_channel_admin
+3 -1
View File
@@ -11,7 +11,9 @@ from app.schemas.mediaserver import MediaServerItemUserState as _SchemaMediaServ
from app.schemas.mediaserver import MediaServerLibrary as _SchemaMediaServerLibrary
from app.schemas.mediaserver import MediaServerPlayItem as _SchemaMediaServerPlayItem
from app.schemas.mediaserver import WebhookEventInfo as _SchemaWebhookEventInfo
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.application.mediaserver import MediaServerIdentityHelper, MusicMediaServerHelper
from app.runtime.log import logger
from app.schemas.types import MediaType
+3 -1
View File
@@ -10,7 +10,9 @@ from slack_bolt import App
from slack_bolt.adapter.socket_mode import SocketModeHandler
from slack_sdk import WebClient
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.domain.context import MediaInfo, Context
from app.domain.metainfo import MetaInfo
from app.runtime.log import logger
@@ -1060,6 +1060,8 @@ AcoustID、AniList、Bangumi、Douban、Fanart 和 IMDb 模块族改用动态运
配置债务由 77 个文件降至 67 个,相关识别、浏览与刮削专项测试通过。
MusicBrainz、ListenBrainz、LrcLib 与 TheAudioDB 模块族也完成同样迁移,配置债务由 67 个文件降至 62 个,
音乐元数据专项测试通过。
Emby、Jellyfin、Feishu、Discord 与 Slack 模块切换到动态运行时配置,模块测试与消息生命周期 ABI 保持;
配置债务由 62 个文件降至 57 个,媒体服务器和消息模块专项测试通过。
同日修正适配器配置下沉边界:OCR、CookieCloud、DoH、Rust 和资源签名等低层实现不再直接依赖
`app.application`,由 `app.runtime.settings` 端口承接组合根注入;未启动装配时仍回退旧 Settings ABI
@@ -9,7 +9,7 @@
"root": "app"
},
"settings_imports": {
"count": 62,
"count": 57,
"files": [
"app/adapters/system/fsproxy.py",
"app/cli.py",
@@ -20,9 +20,6 @@
"app/doctor/runner.py",
"app/factory.py",
"app/main.py",
"app/modules/discord/discord.py",
"app/modules/emby/emby.py",
"app/modules/feishu/feishu.py",
"app/modules/filemanager/module.py",
"app/modules/filemanager/storages/alipan.py",
"app/modules/filemanager/storages/alist.py",
@@ -42,13 +39,11 @@
"app/modules/indexer/spider/tnode.py",
"app/modules/indexer/spider/torrentleech.py",
"app/modules/indexer/spider/yema.py",
"app/modules/jellyfin/jellyfin.py",
"app/modules/postgresql/__init__.py",
"app/modules/qbittorrent/__init__.py",
"app/modules/qqbot/qqbot.py",
"app/modules/redis/__init__.py",
"app/modules/rtorrent/__init__.py",
"app/modules/slack/slack.py",
"app/modules/subtitle/__init__.py",
"app/modules/telegram/telegram.py",
"app/modules/themoviedb/__init__.py",
+6 -6
View File
@@ -14,7 +14,7 @@
"workflow_to_db": []
},
"edge_count": 6421,
"edge_sha256": "6b9946cab961b8c499aad349218832c54c0b581f86ba8dbd992d538534a0322f",
"edge_sha256": "2282230a3d14a429841f4f5a98da557808eb44c54e0b8bc2653a429fbd5f47de",
"edges": [
"app -> app.runtime",
"app -> app.runtime.compat",
@@ -3966,8 +3966,8 @@
"app.modules.discord.discord -> app.foundation",
"app.modules.discord.discord -> app.foundation.size",
"app.modules.discord.discord -> app.runtime",
"app.modules.discord.discord -> app.runtime.config",
"app.modules.discord.discord -> app.runtime.log",
"app.modules.discord.discord -> app.runtime.settings",
"app.modules.discord.discord -> app.schemas",
"app.modules.discord.discord -> app.schemas.types",
"app.modules.douban -> app.adapters",
@@ -4025,8 +4025,8 @@
"app.modules.emby.emby -> app.foundation",
"app.modules.emby.emby -> app.foundation.url",
"app.modules.emby.emby -> app.runtime",
"app.modules.emby.emby -> app.runtime.config",
"app.modules.emby.emby -> app.runtime.log",
"app.modules.emby.emby -> app.runtime.settings",
"app.modules.emby.emby -> app.schemas",
"app.modules.emby.emby -> app.schemas.dashboard",
"app.modules.emby.emby -> app.schemas.mediaserver",
@@ -4068,8 +4068,8 @@
"app.modules.feishu.feishu -> app.domain",
"app.modules.feishu.feishu -> app.domain.context",
"app.modules.feishu.feishu -> app.runtime",
"app.modules.feishu.feishu -> app.runtime.config",
"app.modules.feishu.feishu -> app.runtime.log",
"app.modules.feishu.feishu -> app.runtime.settings",
"app.modules.feishu.feishu -> app.schemas",
"app.modules.feishu.feishu -> app.schemas.message",
"app.modules.feishu.feishu -> app.schemas.types",
@@ -4608,8 +4608,8 @@
"app.modules.jellyfin.jellyfin -> app.foundation",
"app.modules.jellyfin.jellyfin -> app.foundation.url",
"app.modules.jellyfin.jellyfin -> app.runtime",
"app.modules.jellyfin.jellyfin -> app.runtime.config",
"app.modules.jellyfin.jellyfin -> app.runtime.log",
"app.modules.jellyfin.jellyfin -> app.runtime.settings",
"app.modules.jellyfin.jellyfin -> app.schemas",
"app.modules.jellyfin.jellyfin -> app.schemas.dashboard",
"app.modules.jellyfin.jellyfin -> app.schemas.mediaserver",
@@ -4845,8 +4845,8 @@
"app.modules.slack.slack -> app.foundation",
"app.modules.slack.slack -> app.foundation.size",
"app.modules.slack.slack -> app.runtime",
"app.modules.slack.slack -> app.runtime.config",
"app.modules.slack.slack -> app.runtime.log",
"app.modules.slack.slack -> app.runtime.settings",
"app.modules.subtitle -> app.adapters",
"app.modules.subtitle -> app.adapters.network",
"app.modules.subtitle -> app.adapters.network.http",