diff --git a/_text/cards/Aino Vihtanen.json b/_text/cards/Aino Vihtanen.json index 0e62f20..17700c6 100644 --- a/_text/cards/Aino Vihtanen.json +++ b/_text/cards/Aino Vihtanen.json @@ -1,6 +1,6 @@ { - "avatar": "none", - "chat": "Aino Vihtanen - 2026-08-12@16h09m13s142ms", + "avatar": "Aino Vihtanen.png", + "chat": "Aino Vihtanen - 2026-08-13@18h01m20s857ms", "create_date": "2026-08-12T16:09:13.167Z", "creatorcomment": "", "data": { diff --git a/characters/Aino Vihtanen.png b/characters/Aino Vihtanen.png index e4807ed..0db655e 100644 Binary files a/characters/Aino Vihtanen.png and b/characters/Aino Vihtanen.png differ diff --git a/st-export.py b/st-export.py index 2f9475a..b689dc4 100755 --- a/st-export.py +++ b/st-export.py @@ -92,6 +92,18 @@ def export_cards() -> int: json.dump(card, fh, indent=2, ensure_ascii=False, sort_keys=True) fh.write("\n") n += 1 + + # ⚠ PRUNE EXPORTS WHOSE SOURCE IS GONE. Without this, deleting a character in + # the UI left `_text/cards/.json` behind describing a card that no + # longer exists — and it reads as current, which is worse than absent. Found + # by testing a deletion rather than by reading the code: the write path was + # obviously correct and the delete path was simply never written. + live = {f[:-4] + ".json" for f in os.listdir(src) + if f.lower().endswith(".png") and not f.startswith("default_")} if os.path.isdir(src) else set() + for stale in sorted(set(os.listdir(dst)) - live): + if stale.endswith(".json"): + os.remove(os.path.join(dst, stale)) + print(f" pruned _text/cards/{stale} — its PNG is gone") return n