fix: 皮肤包删除后被自动迁移逻辑复活,IPA 下载连击刷屏操作日志
_migrate_old_themes 之前每次 load_config() 都会重跑,只要证书仍引用某皮肤 且旧版 themes 目录还在,删除后会被立即重新生成;现改为仅首次执行一次并 在 config.json 中打标记跳过后续调用。 打包历史下载 IPA 按钮此前无连击防护,前端加 in-flight 禁用态,后端对同一 用户同一任务的下载操作日志增加 5 秒去重,避免连击刷屏审计日志。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
84a2d3db01
commit
c17b7d5ad9
@@ -300,8 +300,14 @@ def _ensure_upload_keys(config: dict) -> bool:
|
||||
|
||||
|
||||
def _migrate_old_themes(config: dict) -> bool:
|
||||
"""将旧式目录皮肤迁移为 ZIP 存入 data/skins/,返回是否有变更"""
|
||||
changed = False
|
||||
"""将旧式目录皮肤迁移为 ZIP 存入 data/skins/,返回是否有变更。
|
||||
|
||||
仅在首次执行(用旧配置升级时)生效,之后写入标记跳过:否则每次 load_config()
|
||||
都会重新执行——一旦某个皮肤被删除,只要对应证书的 theme 仍引用它、且旧版
|
||||
themes 目录还在,就会被立刻重新生成,导致皮肤包无法真正删除。
|
||||
"""
|
||||
if config.get("_legacy_themes_migrated"):
|
||||
return False
|
||||
themes_dir = AUTOMATION_DIR / "themes"
|
||||
for app_id, app in config.get("apps", {}).items():
|
||||
upload_key = app.get("upload_key", "")
|
||||
@@ -336,8 +342,8 @@ def _migrate_old_themes(config: dict) -> bool:
|
||||
app["skins"] = skins
|
||||
if theme != skin_name:
|
||||
cert["theme"] = skin_name
|
||||
changed = True
|
||||
return changed
|
||||
config["_legacy_themes_migrated"] = True
|
||||
return True
|
||||
|
||||
|
||||
def load_config() -> dict:
|
||||
|
||||
Reference in New Issue
Block a user