fix(douyu): 修复查询工作台冷却筛选与 CSV 导出安全 (v0.4.27)
This commit is contained in:
@@ -202,6 +202,17 @@ class OverviewMixin:
|
||||
def _client(self, cookie: str) -> DouyuActivityClient: ...
|
||||
def _mark_task(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def _push_log(self, level: str, message: str) -> None: ...
|
||||
def _refresh_account_gold_balance(
|
||||
self, client: DouyuActivityClient, account: Account
|
||||
) -> dict[str, Any]: ...
|
||||
def _refresh_account_points(
|
||||
self,
|
||||
client: DouyuActivityClient,
|
||||
account: Account,
|
||||
cookie: str,
|
||||
*,
|
||||
ctn: Any = None,
|
||||
) -> dict[str, Any]: ...
|
||||
def _pick_change_wait_bind_info(
|
||||
self, candidates: list[dict], config: dict
|
||||
) -> dict | None: ...
|
||||
@@ -216,6 +227,7 @@ class OverviewMixin:
|
||||
if isinstance(runtime_payload, dict):
|
||||
payload = {**payload, **runtime_payload}
|
||||
return str(payload.get("view") or "").strip()
|
||||
|
||||
def _refresh_account_gold_balance(
|
||||
self, client: DouyuActivityClient, account: Account
|
||||
) -> dict: ...
|
||||
@@ -455,11 +467,7 @@ class OverviewMixin:
|
||||
snapshot = account.overview_snapshot
|
||||
if not isinstance(snapshot, dict) or account.overview_queried_at is None:
|
||||
return None
|
||||
payload = (
|
||||
self._task_payload(task)
|
||||
if hasattr(self, "_task_payload")
|
||||
else {}
|
||||
)
|
||||
payload = self._task_payload(task) if hasattr(self, "_task_payload") else {}
|
||||
if bool(payload.get("force_refresh")):
|
||||
return None
|
||||
age = (now - account.overview_queried_at).total_seconds()
|
||||
@@ -491,9 +499,7 @@ class OverviewMixin:
|
||||
cached["view"] = view or str(cached.get("view") or "")
|
||||
message = _overview_success_message(
|
||||
cached,
|
||||
cached.get("errors")
|
||||
if isinstance(cached.get("errors"), dict)
|
||||
else {},
|
||||
cached.get("errors") if isinstance(cached.get("errors"), dict) else {},
|
||||
view=view,
|
||||
)
|
||||
self._push_log(
|
||||
@@ -788,9 +794,7 @@ class OverviewMixin:
|
||||
previous_overview.get("high_value_goods") or []
|
||||
)
|
||||
overview["pending_domains"].append(DOMAIN_STOREHOME)
|
||||
errors["limited_goods"] = (
|
||||
"本地商品快照已过期,已加入后台同步队列"
|
||||
)
|
||||
errors["limited_goods"] = "本地商品快照已过期,已加入后台同步队列"
|
||||
enqueue_account_work(
|
||||
db,
|
||||
account_id=int(account.id),
|
||||
@@ -1006,9 +1010,7 @@ class OverviewMixin:
|
||||
]
|
||||
all_records.extend((scope, r) for r in rows)
|
||||
overview[f"exchange_record_count_{scope}"] = len(rows)
|
||||
overview["domain_sources"][DOMAIN_EXCHANGE_RECORDS] = (
|
||||
"official_bootstrap"
|
||||
)
|
||||
overview["domain_sources"][DOMAIN_EXCHANGE_RECORDS] = "official_bootstrap"
|
||||
|
||||
overview["exchange_record_count"] = len(all_records)
|
||||
# 兑换记录开始前结束前一步可能留下的角色快照事务。
|
||||
@@ -1249,9 +1251,7 @@ class OverviewMixin:
|
||||
else:
|
||||
bind_label = "可换绑"
|
||||
elif (account.change_role_wait_time or 0) > 0:
|
||||
bind_label = (
|
||||
f"换绑冷却 {self._format_wait_time(account.change_role_wait_time)}"
|
||||
)
|
||||
bind_label = f"换绑冷却 {self._format_wait_time(account.change_role_wait_time)}"
|
||||
else:
|
||||
bind_label = "可换绑"
|
||||
elif account.role_bind_status == "pending":
|
||||
|
||||
Reference in New Issue
Block a user