mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-07 16:36:53 +08:00
refactor(schemas): 统一 message/notification 命名边界,旧名收敛至兼容映射表
- notification 域:渠道能力(MessageChannel→NotificationChannel、ChannelCapability* 迁入 notification.py) - message 域:消息收发(Notification→Message、NotificationType→MessageType、CommingMessage→IncomingMessage、NotificationHistoryItem→MessageHistoryItem、NotificationClear*→MessageClear*) - Agent 工具契约:send_notification_message→send_message、notification_callback→message_callback - 源码不保留旧名物理别名,旧导入经 app/runtime/compat/manifest.py SYMBOL_ALIASES 惰性解析 - API 路径与持久化键冻结不变,前端零改动 - 新增兼容守护测试与 docs/rules/07 命名边界规范
This commit is contained in:
@@ -5,8 +5,8 @@ from pathlib import Path
|
||||
|
||||
from app.runtime.extensions.service_registry import ServiceConfigHelper
|
||||
from app.runtime.log import logger
|
||||
from app.schemas import Notification, NotificationConf, MediaServerConf, DownloaderConf
|
||||
from app.schemas.types import ModuleType, DownloaderType, MediaServerType, MessageChannel, StorageSchema, \
|
||||
from app.schemas import Message, NotificationConf, MediaServerConf, DownloaderConf
|
||||
from app.schemas.types import ModuleType, DownloaderType, MediaServerType, NotificationChannel, StorageSchema, \
|
||||
OtherModulesType, SystemConfigKey, MediaRecognizeType
|
||||
from app.runtime.reload import ConfigReloadMixin
|
||||
|
||||
@@ -69,7 +69,7 @@ class _ModuleBase(ConfigReloadMixin, metaclass=ABCMeta):
|
||||
def get_subtype() -> Union[
|
||||
DownloaderType,
|
||||
MediaServerType,
|
||||
MessageChannel,
|
||||
NotificationChannel,
|
||||
StorageSchema,
|
||||
OtherModulesType,
|
||||
MediaRecognizeType,
|
||||
@@ -214,7 +214,7 @@ class _MessageBase(ServiceBase[TService, NotificationConf]):
|
||||
初始化消息基类,并设置消息通道
|
||||
"""
|
||||
super().__init__()
|
||||
self._channel: Optional[MessageChannel] = None
|
||||
self._channel: Optional[NotificationChannel] = None
|
||||
|
||||
def get_configs(self) -> Dict[str, NotificationConf]:
|
||||
"""
|
||||
@@ -227,7 +227,7 @@ class _MessageBase(ServiceBase[TService, NotificationConf]):
|
||||
return {}
|
||||
return {conf.name: conf for conf in configs if conf.type == self._service_name and conf.enabled}
|
||||
|
||||
def check_message(self, message: Notification, source: str = None) -> bool:
|
||||
def check_message(self, message: Message, source: str = None) -> bool:
|
||||
"""
|
||||
检查消息渠道及消息类型,判断是否处理消息
|
||||
|
||||
|
||||
Reference in New Issue
Block a user