mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 15:38:19 +08:00
refactor: unify service configuration boundary
This commit is contained in:
@@ -13,7 +13,7 @@ from app.domain.context import Context, MediaInfo, MusicInfo, TorrentInfo
|
||||
from app.domain.meta.metabase import MetaBase
|
||||
from app.foundation.identity import normalize_internal_user_id
|
||||
from app.application.messaging.message import MessageTemplateHelper
|
||||
from app.runtime.extensions.service_config import ServiceConfigHelper
|
||||
from app.application.notification import get_notification_switch
|
||||
from app.runtime.log import logger
|
||||
from app.schemas.message import MessageResponse
|
||||
from app.schemas.message import Message
|
||||
@@ -159,7 +159,7 @@ class NotificationMixin:
|
||||
# 发送消息按设置隔离
|
||||
if not dispatch_message.userid and dispatch_message.mtype:
|
||||
# 消息隔离设置
|
||||
notify_action = ServiceConfigHelper.get_notification_switch(
|
||||
notify_action = get_notification_switch(
|
||||
dispatch_message.mtype
|
||||
)
|
||||
if notify_action:
|
||||
@@ -277,7 +277,7 @@ class NotificationMixin:
|
||||
# 发送消息按设置隔离
|
||||
if not dispatch_message.userid and dispatch_message.mtype:
|
||||
# 消息隔离设置
|
||||
notify_action = ServiceConfigHelper.get_notification_switch(
|
||||
notify_action = get_notification_switch(
|
||||
dispatch_message.mtype
|
||||
)
|
||||
if notify_action:
|
||||
|
||||
@@ -5,7 +5,7 @@ from typing import Callable, Dict, List, Union, Optional, Generator, Any, Tuple
|
||||
from app.chain import ChainBase
|
||||
from app.runtime.config import global_vars
|
||||
from app.application.chain.data import get_chain_media_server_port
|
||||
from app.runtime.extensions.service_config import ServiceConfigHelper
|
||||
from app.application.mediaserver import get_mediaserver_configs
|
||||
from app.runtime.log import logger
|
||||
from app.schemas.mediaserver import MediaServerLibrary
|
||||
from app.schemas.mediaserver import MediaServerItem
|
||||
@@ -458,7 +458,7 @@ class MediaServerChain(ChainBase):
|
||||
:param server: 指定媒体服务器名称,为空时同步全部已启用服务器
|
||||
"""
|
||||
# 设置的媒体服务器
|
||||
mediaservers = ServiceConfigHelper.get_mediaserver_configs()
|
||||
mediaservers = get_mediaserver_configs(include_disabled=True)
|
||||
if not mediaservers:
|
||||
if progress_callback:
|
||||
progress_callback(value=100, text="未配置媒体服务器,跳过同步")
|
||||
|
||||
Reference in New Issue
Block a user