refactor:重构配置热加载

This commit is contained in:
jxxghp
2025-06-03 20:56:21 +08:00
parent 5f18a21e86
commit b4ed2880f7
18 changed files with 291 additions and 80 deletions

View File

@@ -1,17 +1,19 @@
from typing import Optional, Tuple, Union, Any, List, Generator
from app import schemas
from app.core.config import on_config_change
from app.core.context import MediaInfo
from app.core.event import eventmanager
from app.log import logger
from app.modules import _ModuleBase, _MediaServerBase
from app.modules.plex.plex import Plex
from app.schemas import AuthCredentials, AuthInterceptCredentials
from app.schemas.types import MediaType, ModuleType, ChainEventType, MediaServerType
from app.schemas.types import MediaType, ModuleType, ChainEventType, MediaServerType, SystemConfigKey
class PlexModule(_ModuleBase, _MediaServerBase[Plex]):
@on_config_change([SystemConfigKey.MediaServers.value])
def init_module(self) -> None:
"""
初始化模块