mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 07:27:15 +08:00
fix downloaders
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
from typing import List
|
||||
|
||||
from app.db.systemconfig_oper import SystemConfigOper
|
||||
from app.schemas.system import DownloaderConf
|
||||
from app.schemas.types import SystemConfigKey
|
||||
|
||||
|
||||
@@ -10,11 +13,11 @@ class DownloaderHelper:
|
||||
def __init__(self):
|
||||
self.systemconfig = SystemConfigOper()
|
||||
|
||||
def get_downloaders(self) -> dict:
|
||||
def get_downloaders(self) -> List[DownloaderConf]:
|
||||
"""
|
||||
获取下载器
|
||||
"""
|
||||
downloader_conf: dict = self.systemconfig.get(SystemConfigKey.Downloaders)
|
||||
if not downloader_conf:
|
||||
return {}
|
||||
return downloader_conf
|
||||
downloader_confs: List[dict] = self.systemconfig.get(SystemConfigKey.Downloaders)
|
||||
if not downloader_confs:
|
||||
return []
|
||||
return [DownloaderConf(**conf) for conf in downloader_confs]
|
||||
|
||||
Reference in New Issue
Block a user