mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 07:27:15 +08:00
refactor: keep runtime settings below adapters
This commit is contained in:
Vendored
+2
-7
@@ -1,9 +1,8 @@
|
||||
import json
|
||||
import importlib
|
||||
from typing import Any, Dict, Tuple, Optional
|
||||
|
||||
from app.application.configuration import get_runtime_settings
|
||||
from app.runtime.log import logger
|
||||
from app.runtime.settings import get_runtime_setting
|
||||
from app.foundation.crypto import CryptoJsUtils, HashUtils
|
||||
from app.adapters.network.http import RequestUtils
|
||||
from app.domain import site as site_rules
|
||||
@@ -13,11 +12,7 @@ from app.foundation.url import UrlUtils
|
||||
|
||||
def _runtime_setting(key: str) -> Any:
|
||||
"""读取 CookieCloud 配置服务,未装配时回退旧 Settings ABI。"""
|
||||
try:
|
||||
return get_runtime_settings().get(key)
|
||||
except RuntimeError:
|
||||
legacy_settings = importlib.import_module("app.runtime.config").settings
|
||||
return getattr(legacy_settings, key)
|
||||
return get_runtime_setting(key)
|
||||
|
||||
|
||||
class CookieCloudHelper:
|
||||
|
||||
Reference in New Issue
Block a user