refactor: route media source settings through runtime

This commit is contained in:
jxxghp
2026-08-23 03:20:03 +08:00
parent 061a92eab0
commit c89066d96f
13 changed files with 44 additions and 32 deletions
+3 -1
View File
@@ -6,7 +6,9 @@ import cn2an
from app.schemas.context import MediaPerson as _SchemaMediaPerson
from app.schemas.tmdb import TmdbSeason as _SchemaTmdbSeason
from app.schemas.tmdb import TmdbEpisode as _SchemaTmdbEpisode
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.domain.context import MediaInfo
from app.domain.meta.metabase import MetaBase
from app.runtime.log import logger
+3 -1
View File
@@ -5,7 +5,9 @@ from typing import Union
import ruamel.yaml
from ruamel.yaml import CommentedMap
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.runtime.log import logger
from app.schemas.category import CategoryConfig
from app.foundation.singleton import WeakSingleton
+3 -1
View File
@@ -2,7 +2,9 @@ from pathlib import Path
from typing import Optional, Tuple
from xml.dom import minidom
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.domain.context import MediaInfo
from app.domain.meta.metabase import MetaBase
from app.schemas.types import MediaType
+3 -1
View File
@@ -6,7 +6,9 @@ from time import time
from typing import Any, Optional
from app.runtime.cache import FileCache, TTLCache
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.domain.meta.metabase import MetaBase
from app.runtime.log import logger
from app.schemas.types import MediaSource, MediaType
+3 -1
View File
@@ -2,7 +2,9 @@ import re
import traceback
from typing import Optional, List
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.runtime.log import logger
from app.schemas.types import MediaType
from app.foundation import text as text_tools
@@ -1,5 +1,7 @@
from app.runtime.cache import cached
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from ..tmdb import TMDb
try:
+3 -1
View File
@@ -10,7 +10,9 @@ import requests
import requests.exceptions
from app.runtime.cache import cached, fresh, async_fresh
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.adapters.network.http import RequestUtils, AsyncRequestUtils
from .exceptions import TMDbException, TMDbConnectionError
+3 -1
View File
@@ -1,7 +1,9 @@
from threading import Lock
from typing import Optional, Tuple, Union
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.runtime.log import logger
from app.modules import _ModuleBase
from app.modules.thetvdb import tvdb_v4_official
+3 -1
View File
@@ -8,7 +8,9 @@ import urllib.parse
from http import HTTPStatus
from app.runtime.cache import cached
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.adapters.network.http import RequestUtils
+3 -1
View File
@@ -7,7 +7,9 @@ from enum import Enum
from typing import List, Optional, Union
from urllib.parse import quote
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.runtime.log import logger
from app.adapters.network.http import RequestUtils, requests