refactor: expand chain runtime config snapshot

This commit is contained in:
jxxghp
2026-08-22 13:21:52 +08:00
parent 941c167084
commit fa2bf1fe4d
13 changed files with 78 additions and 50 deletions
+3 -5
View File
@@ -19,7 +19,6 @@ from app.domain import title as title_rules
from app.domain.context import Context, MediaInfo
from app.domain.meta.metabase import MetaBase
from app.foundation import url as url_tools
from app.runtime.config import settings
from app.runtime.log import logger
from app.schemas.download import DownloadDirectory
from app.schemas.file import FileURI
@@ -1130,7 +1129,7 @@ class MediaInteractionChain(ChainBase):
source=source,
title=title,
userid=userid,
link=settings.MP_DOMAIN("#/resource"),
link=self.runtime_config.resource_url,
buttons=buttons,
original_message_id=original_message_id,
original_chat_id=original_chat_id,
@@ -1533,12 +1532,11 @@ class MediaInteractionChain(ChainBase):
for sea, no_exist in season_map.items()
]
@staticmethod
def _should_auto_download(userid: Union[str, int]) -> bool:
def _should_auto_download(self, userid: Union[str, int]) -> bool:
"""
判断当前用户是否命中自动下载名单。
"""
auto_download_user = settings.AUTO_DOWNLOAD_USER
auto_download_user = self.runtime_config.auto_download_user
return bool(
auto_download_user
and (