mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 15:38:19 +08:00
refactor(config): retire RuntimeSettingsCompat host usage
This commit is contained in:
@@ -38,11 +38,11 @@ class TheTvDbModule(_ModuleBase):
|
||||
action = "刷新" if is_retry else "创建"
|
||||
logger.info(f"开始{action}TVDB登录会话...")
|
||||
try:
|
||||
if not get_runtime_setting("TVDB_V4_API_KEY"):
|
||||
if not get_runtime_setting('TVDB_V4_API_KEY'):
|
||||
raise ConnectionError("TVDB API Key 未配置,无法初始化会话。")
|
||||
self.tvdb = tvdb_v4_official.TVDB(apikey=get_runtime_setting("TVDB_V4_API_KEY"),
|
||||
pin=get_runtime_setting("TVDB_V4_API_PIN"),
|
||||
proxy=get_runtime_setting("PROXY"),
|
||||
self.tvdb = tvdb_v4_official.TVDB(apikey=get_runtime_setting('TVDB_V4_API_KEY'),
|
||||
pin=get_runtime_setting('TVDB_V4_API_PIN'),
|
||||
proxy=get_runtime_setting('PROXY'),
|
||||
timeout=self.__timeout)
|
||||
if self.tvdb:
|
||||
logger.info(f"TVDB登录会话{action}成功。")
|
||||
|
||||
@@ -7,11 +7,9 @@ import json
|
||||
import urllib.parse
|
||||
from http import HTTPStatus
|
||||
|
||||
from app.runtime.cache import cached
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.adapters.network.http import RequestUtils
|
||||
from app.runtime.cache import cached
|
||||
from app.runtime.settings import get_runtime_setting
|
||||
|
||||
|
||||
class Auth:
|
||||
@@ -69,7 +67,7 @@ class Request:
|
||||
self.proxy = proxy
|
||||
self.timeout = timeout
|
||||
|
||||
@cached(maxsize=settings.CONF.tmdb, ttl=settings.CONF.meta, skip_none=True)
|
||||
@cached(maxsize=get_runtime_setting('CONF').tmdb, ttl=get_runtime_setting('CONF').meta, skip_none=True)
|
||||
def make_request(self, url: str, if_modified_since: bool = None):
|
||||
"""
|
||||
向指定的 URL 发起请求并返回数据
|
||||
|
||||
Reference in New Issue
Block a user