From 3832a20aed7a7079fb977a96b8c1c87b74559b2a Mon Sep 17 00:00:00 2001 From: gamer147 Date: Fri, 29 May 2026 21:03:12 -0400 Subject: [PATCH] feat(loader): skip empty deck slots in user-data export A /load/index response carries every deck slot, mostly empty placeholders; emit only the real (non-empty) decks so the dump is a handful of decks instead of ~100 empty slots. Co-Authored-By: Claude Opus 4.8 --- SVSimLoader/CaptureWriter.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/SVSimLoader/CaptureWriter.cs b/SVSimLoader/CaptureWriter.cs index fd5a23c..977f12f 100644 --- a/SVSimLoader/CaptureWriter.cs +++ b/SVSimLoader/CaptureWriter.cs @@ -384,6 +384,12 @@ internal static class CaptureWriter for (int i = 0; i < deckList.Count; i++) { var entry = deckList[i]; + // /load/index ships every deck slot, most of them empty placeholders. Skip the + // empty ones — the import drops them anyway, and it keeps the dump to the few real + // decks instead of ~100 empty slots. + var cardArr = ExtractLongArray(entry, "card_id_array"); + if (cardArr == null || cardArr.Count == 0) continue; + var d = new Dictionary { { "deck_format", fmt.Format } }; Copy(entry, "deck_no", d, "deck_no"); Copy(entry, "deck_name", d, "deck_name"); @@ -392,8 +398,7 @@ internal static class CaptureWriter Copy(entry, "leader_skin_id", d, "leader_skin_id"); Copy(entry, "is_random_leader_skin", d, "is_random_leader_skin"); Copy(entry, "rotation_id", d, "my_rotation_id"); // UserDeck.rotation_id -> import my_rotation_id - var arr = ExtractLongArray(entry, "card_id_array"); - if (arr != null) d["card_id_array"] = arr; + d["card_id_array"] = cardArr; decks.Add(d); } }