mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-30 12:36:55 +08:00
refactor: route indexer module settings through runtime
This commit is contained in:
@@ -8,7 +8,9 @@ from urllib.parse import urljoin, urlsplit
|
||||
|
||||
from requests import Session
|
||||
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.adapters.network.cloudflare import under_challenge
|
||||
from app.runtime.log import logger
|
||||
from app.adapters.network.http import RequestUtils
|
||||
|
||||
@@ -4,7 +4,9 @@ from urllib.parse import urljoin
|
||||
from typing import Optional, Tuple
|
||||
|
||||
from app.runtime.log import logger
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.adapters.network.http import RequestUtils
|
||||
from app.domain import site as site_rules
|
||||
from app.foundation import temporal as time_tools
|
||||
@@ -232,4 +234,4 @@ class RousiSiteUserInfo(SiteParserBase):
|
||||
proxies=settings.PROXY if self._proxy else None
|
||||
).post_res(
|
||||
url=urljoin(self._base_url, "api/messages/read-all")
|
||||
)
|
||||
)
|
||||
|
||||
@@ -9,7 +9,9 @@ from fastapi.concurrency import run_in_threadpool
|
||||
from jinja2 import Template
|
||||
from pyquery import PyQuery
|
||||
|
||||
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.adapters.system import rust as rust_accel
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import urllib.parse
|
||||
from typing import Tuple, List
|
||||
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.application.configuration import get_configured_system_config as SystemConfigOper
|
||||
from app.runtime.log import logger
|
||||
from app.schemas.types import MediaType
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from typing import Tuple, List, Optional
|
||||
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.application.configuration import get_configured_system_config as SystemConfigOper
|
||||
from app.runtime.log import logger
|
||||
from app.schemas.types import MediaType
|
||||
|
||||
@@ -4,7 +4,9 @@ import re
|
||||
from typing import Tuple, List, Optional
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.application.configuration import get_configured_system_config as SystemConfigOper
|
||||
from app.runtime.log import logger
|
||||
from app.schemas.types import MediaType
|
||||
|
||||
@@ -2,7 +2,9 @@ import base64
|
||||
import json
|
||||
from typing import List, Optional, Tuple
|
||||
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.application.configuration import get_configured_system_config as SystemConfigOper
|
||||
from app.runtime.log import logger
|
||||
from app.schemas.types import MediaType
|
||||
|
||||
@@ -3,7 +3,9 @@ import json
|
||||
import time
|
||||
from typing import List, Optional, Tuple
|
||||
|
||||
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.adapters.network.http import AsyncRequestUtils, RequestUtils
|
||||
|
||||
@@ -2,7 +2,9 @@ import re
|
||||
from typing import Tuple, List, Optional
|
||||
|
||||
from app.runtime.cache import cached
|
||||
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, AsyncRequestUtils
|
||||
from app.foundation.singleton import SingletonClass
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
from typing import List, Tuple, Optional
|
||||
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.schemas.types import MediaType
|
||||
from app.adapters.network.http import RequestUtils, AsyncRequestUtils
|
||||
|
||||
@@ -2,7 +2,9 @@ import base64
|
||||
import json
|
||||
from typing import List, Optional, Tuple
|
||||
|
||||
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.adapters.network.http import AsyncRequestUtils, RequestUtils
|
||||
|
||||
@@ -1064,6 +1064,8 @@ Emby、Jellyfin、Feishu、Discord 与 Slack 模块切换到动态运行时配
|
||||
配置债务由 62 个文件降至 57 个,媒体服务器和消息模块专项测试通过。
|
||||
文件管理器及 Alist、Rclone、U115、SMB、Alipan 存储实现切换到动态运行时配置,保留模块级 global_vars 与
|
||||
存储公开方法;配置债务由 57 个文件降至 50 个,文件管理与存储专项测试通过。
|
||||
Indexer parser/spider 模块族切换到动态运行时配置,站点搜索 URL、解析与分类行为保持;配置债务由 50 个文件
|
||||
降至 39 个,Indexer 专项测试通过。
|
||||
|
||||
同日修正适配器配置下沉边界:OCR、CookieCloud、DoH、Rust 和资源签名等低层实现不再直接依赖
|
||||
`app.application`,由 `app.runtime.settings` 端口承接组合根注入;未启动装配时仍回退旧 Settings ABI,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"root": "app"
|
||||
},
|
||||
"settings_imports": {
|
||||
"count": 50,
|
||||
"count": 39,
|
||||
"files": [
|
||||
"app/adapters/system/fsproxy.py",
|
||||
"app/cli.py",
|
||||
@@ -21,17 +21,6 @@
|
||||
"app/factory.py",
|
||||
"app/main.py",
|
||||
"app/modules/filemanager/storages/local.py",
|
||||
"app/modules/indexer/parser/__init__.py",
|
||||
"app/modules/indexer/parser/rousi.py",
|
||||
"app/modules/indexer/spider/__init__.py",
|
||||
"app/modules/indexer/spider/haidan.py",
|
||||
"app/modules/indexer/spider/hddolby.py",
|
||||
"app/modules/indexer/spider/mtorrent.py",
|
||||
"app/modules/indexer/spider/rousi.py",
|
||||
"app/modules/indexer/spider/sunnypt.py",
|
||||
"app/modules/indexer/spider/tnode.py",
|
||||
"app/modules/indexer/spider/torrentleech.py",
|
||||
"app/modules/indexer/spider/yema.py",
|
||||
"app/modules/postgresql/__init__.py",
|
||||
"app/modules/qbittorrent/__init__.py",
|
||||
"app/modules/qqbot/qqbot.py",
|
||||
|
||||
+12
-12
@@ -14,7 +14,7 @@
|
||||
"workflow_to_db": []
|
||||
},
|
||||
"edge_count": 6425,
|
||||
"edge_sha256": "6cd4675c9165f8837860621c2f6c66574dc17e57d6b0b0421145e14b880e2257",
|
||||
"edge_sha256": "06fb9c478770d0a27b22f8bcde92644fc5a2b14775446953716b4ed492b32042",
|
||||
"edges": [
|
||||
"app -> app.runtime",
|
||||
"app -> app.runtime.compat",
|
||||
@@ -4326,8 +4326,8 @@
|
||||
"app.modules.indexer.parser -> app.foundation",
|
||||
"app.modules.indexer.parser -> app.foundation.size",
|
||||
"app.modules.indexer.parser -> app.runtime",
|
||||
"app.modules.indexer.parser -> app.runtime.config",
|
||||
"app.modules.indexer.parser -> app.runtime.log",
|
||||
"app.modules.indexer.parser -> app.runtime.settings",
|
||||
"app.modules.indexer.parser.bitpt -> app.foundation",
|
||||
"app.modules.indexer.parser.bitpt -> app.foundation.size",
|
||||
"app.modules.indexer.parser.bitpt -> app.foundation.temporal",
|
||||
@@ -4434,8 +4434,8 @@
|
||||
"app.modules.indexer.parser.rousi -> app.modules.indexer",
|
||||
"app.modules.indexer.parser.rousi -> app.modules.indexer.parser",
|
||||
"app.modules.indexer.parser.rousi -> app.runtime",
|
||||
"app.modules.indexer.parser.rousi -> app.runtime.config",
|
||||
"app.modules.indexer.parser.rousi -> app.runtime.log",
|
||||
"app.modules.indexer.parser.rousi -> app.runtime.settings",
|
||||
"app.modules.indexer.parser.small_horse -> app.foundation",
|
||||
"app.modules.indexer.parser.small_horse -> app.foundation.dom",
|
||||
"app.modules.indexer.parser.small_horse -> app.foundation.size",
|
||||
@@ -4496,8 +4496,8 @@
|
||||
"app.modules.indexer.spider -> app.foundation.temporal",
|
||||
"app.modules.indexer.spider -> app.foundation.url",
|
||||
"app.modules.indexer.spider -> app.runtime",
|
||||
"app.modules.indexer.spider -> app.runtime.config",
|
||||
"app.modules.indexer.spider -> app.runtime.log",
|
||||
"app.modules.indexer.spider -> app.runtime.settings",
|
||||
"app.modules.indexer.spider -> app.schemas",
|
||||
"app.modules.indexer.spider -> app.schemas.types",
|
||||
"app.modules.indexer.spider.haidan -> app.adapters",
|
||||
@@ -4510,8 +4510,8 @@
|
||||
"app.modules.indexer.spider.haidan -> app.foundation",
|
||||
"app.modules.indexer.spider.haidan -> app.foundation.temporal",
|
||||
"app.modules.indexer.spider.haidan -> app.runtime",
|
||||
"app.modules.indexer.spider.haidan -> app.runtime.config",
|
||||
"app.modules.indexer.spider.haidan -> app.runtime.log",
|
||||
"app.modules.indexer.spider.haidan -> app.runtime.settings",
|
||||
"app.modules.indexer.spider.haidan -> app.schemas",
|
||||
"app.modules.indexer.spider.haidan -> app.schemas.types",
|
||||
"app.modules.indexer.spider.hddolby -> app.adapters",
|
||||
@@ -4522,8 +4522,8 @@
|
||||
"app.modules.indexer.spider.hddolby -> app.domain",
|
||||
"app.modules.indexer.spider.hddolby -> app.domain.site",
|
||||
"app.modules.indexer.spider.hddolby -> app.runtime",
|
||||
"app.modules.indexer.spider.hddolby -> app.runtime.config",
|
||||
"app.modules.indexer.spider.hddolby -> app.runtime.log",
|
||||
"app.modules.indexer.spider.hddolby -> app.runtime.settings",
|
||||
"app.modules.indexer.spider.hddolby -> app.schemas",
|
||||
"app.modules.indexer.spider.hddolby -> app.schemas.types",
|
||||
"app.modules.indexer.spider.mtorrent -> app.adapters",
|
||||
@@ -4536,8 +4536,8 @@
|
||||
"app.modules.indexer.spider.mtorrent -> app.foundation",
|
||||
"app.modules.indexer.spider.mtorrent -> app.foundation.temporal",
|
||||
"app.modules.indexer.spider.mtorrent -> app.runtime",
|
||||
"app.modules.indexer.spider.mtorrent -> app.runtime.config",
|
||||
"app.modules.indexer.spider.mtorrent -> app.runtime.log",
|
||||
"app.modules.indexer.spider.mtorrent -> app.runtime.settings",
|
||||
"app.modules.indexer.spider.mtorrent -> app.schemas",
|
||||
"app.modules.indexer.spider.mtorrent -> app.schemas.types",
|
||||
"app.modules.indexer.spider.rousi -> app.adapters",
|
||||
@@ -4550,8 +4550,8 @@
|
||||
"app.modules.indexer.spider.rousi -> app.foundation",
|
||||
"app.modules.indexer.spider.rousi -> app.foundation.temporal",
|
||||
"app.modules.indexer.spider.rousi -> app.runtime",
|
||||
"app.modules.indexer.spider.rousi -> app.runtime.config",
|
||||
"app.modules.indexer.spider.rousi -> app.runtime.log",
|
||||
"app.modules.indexer.spider.rousi -> app.runtime.settings",
|
||||
"app.modules.indexer.spider.rousi -> app.schemas",
|
||||
"app.modules.indexer.spider.rousi -> app.schemas.types",
|
||||
"app.modules.indexer.spider.sunnypt -> app.adapters",
|
||||
@@ -4560,8 +4560,8 @@
|
||||
"app.modules.indexer.spider.sunnypt -> app.foundation",
|
||||
"app.modules.indexer.spider.sunnypt -> app.foundation.temporal",
|
||||
"app.modules.indexer.spider.sunnypt -> app.runtime",
|
||||
"app.modules.indexer.spider.sunnypt -> app.runtime.config",
|
||||
"app.modules.indexer.spider.sunnypt -> app.runtime.log",
|
||||
"app.modules.indexer.spider.sunnypt -> app.runtime.settings",
|
||||
"app.modules.indexer.spider.sunnypt -> app.schemas",
|
||||
"app.modules.indexer.spider.sunnypt -> app.schemas.types",
|
||||
"app.modules.indexer.spider.tnode -> app.adapters",
|
||||
@@ -4572,8 +4572,8 @@
|
||||
"app.modules.indexer.spider.tnode -> app.foundation.temporal",
|
||||
"app.modules.indexer.spider.tnode -> app.runtime",
|
||||
"app.modules.indexer.spider.tnode -> app.runtime.cache",
|
||||
"app.modules.indexer.spider.tnode -> app.runtime.config",
|
||||
"app.modules.indexer.spider.tnode -> app.runtime.log",
|
||||
"app.modules.indexer.spider.tnode -> app.runtime.settings",
|
||||
"app.modules.indexer.spider.torrentleech -> app.adapters",
|
||||
"app.modules.indexer.spider.torrentleech -> app.adapters.network",
|
||||
"app.modules.indexer.spider.torrentleech -> app.adapters.network.http",
|
||||
@@ -4581,8 +4581,8 @@
|
||||
"app.modules.indexer.spider.torrentleech -> app.foundation.temporal",
|
||||
"app.modules.indexer.spider.torrentleech -> app.foundation.text",
|
||||
"app.modules.indexer.spider.torrentleech -> app.runtime",
|
||||
"app.modules.indexer.spider.torrentleech -> app.runtime.config",
|
||||
"app.modules.indexer.spider.torrentleech -> app.runtime.log",
|
||||
"app.modules.indexer.spider.torrentleech -> app.runtime.settings",
|
||||
"app.modules.indexer.spider.torrentleech -> app.schemas",
|
||||
"app.modules.indexer.spider.torrentleech -> app.schemas.types",
|
||||
"app.modules.indexer.spider.yema -> app.adapters",
|
||||
@@ -4591,8 +4591,8 @@
|
||||
"app.modules.indexer.spider.yema -> app.foundation",
|
||||
"app.modules.indexer.spider.yema -> app.foundation.temporal",
|
||||
"app.modules.indexer.spider.yema -> app.runtime",
|
||||
"app.modules.indexer.spider.yema -> app.runtime.config",
|
||||
"app.modules.indexer.spider.yema -> app.runtime.log",
|
||||
"app.modules.indexer.spider.yema -> app.runtime.settings",
|
||||
"app.modules.indexer.spider.yema -> app.schemas",
|
||||
"app.modules.indexer.spider.yema -> app.schemas.types",
|
||||
"app.modules.jellyfin -> app.modules",
|
||||
|
||||
Reference in New Issue
Block a user