mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-05-16 13:55:28 +08:00
fix downloaders && mediaservers && notifications
This commit is contained in:
20
app/helper/downloader.py
Normal file
20
app/helper/downloader.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from app.db.systemconfig_oper import SystemConfigOper
|
||||
from app.schemas.types import SystemConfigKey
|
||||
|
||||
|
||||
class DownloaderHelper:
|
||||
"""
|
||||
下载器帮助类
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self.systemconfig = SystemConfigOper()
|
||||
|
||||
def get_downloaders(self) -> dict:
|
||||
"""
|
||||
获取下载器
|
||||
"""
|
||||
downloader_conf: dict = self.systemconfig.get(SystemConfigKey.Downloaders)
|
||||
if not downloader_conf:
|
||||
return {}
|
||||
return downloader_conf
|
||||
20
app/helper/mediaserver.py
Normal file
20
app/helper/mediaserver.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from app.db.systemconfig_oper import SystemConfigOper
|
||||
from app.schemas.types import SystemConfigKey
|
||||
|
||||
|
||||
class MediaServerHelper:
|
||||
"""
|
||||
媒体服务器帮助类
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self.systemconfig = SystemConfigOper()
|
||||
|
||||
def get_mediaservers(self) -> dict:
|
||||
"""
|
||||
获取媒体服务器
|
||||
"""
|
||||
mediaserver_conf: dict = self.systemconfig.get(SystemConfigKey.MediaServers)
|
||||
if not mediaserver_conf:
|
||||
return {}
|
||||
return mediaserver_conf
|
||||
20
app/helper/notification.py
Normal file
20
app/helper/notification.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from app.db.systemconfig_oper import SystemConfigOper
|
||||
from app.schemas.types import SystemConfigKey
|
||||
|
||||
|
||||
class NotificationHelper:
|
||||
"""
|
||||
消息通知渠道帮助类
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self.systemconfig = SystemConfigOper()
|
||||
|
||||
def get_notifications(self) -> dict:
|
||||
"""
|
||||
获取消息通知渠道
|
||||
"""
|
||||
notification_conf: dict = self.systemconfig.get(SystemConfigKey.Notifications)
|
||||
if not notification_conf:
|
||||
return {}
|
||||
return notification_conf
|
||||
Reference in New Issue
Block a user