feat(owned-cards): add owned-only workflow, multi-file parsing, and recommendations export\n\n- Prompt to use only owned cards (gated by presence of lists)\n- Support .txt/.csv owned lists, multi-select; commander exempt\n- Owned-only filtering + add guard; recommendations CSV/TXT when incomplete\n- CSV Owned column when not owned-only\n- Docs and Docker updated (owned_cards + config mounts)\n- CI: Windows EXE on tag; Docker Hub tag fix (no major.minor)\n- Changelog added; RELEASE_NOTES.md ignored

This commit is contained in:
mwisnowski 2025-08-25 09:48:05 -07:00
parent 5f922835a6
commit acfb29cafb
16 changed files with 480 additions and 261 deletions

View file

@ -166,7 +166,7 @@ class ReportingMixin:
headers = [
"Name","Count","Type","ManaCost","ManaValue","Colors","Power","Toughness",
"Role","SubRole","AddedBy","TriggerTag","Synergy","Tags","Text"
"Role","SubRole","AddedBy","TriggerTag","Synergy","Tags","Text","Owned"
]
# Precedence list for sorting
@ -200,6 +200,13 @@ class ReportingMixin:
rows: List[tuple] = [] # (sort_key, row_data)
# Prepare owned lookup if available
owned_set_lower = set()
try:
owned_set_lower = {n.lower() for n in (getattr(self, 'owned_card_names', set()) or set())}
except Exception:
owned_set_lower = set()
for name, info in self.card_library.items():
base_type = info.get('Card Type') or info.get('Type','')
base_mc = info.get('Mana Cost','')
@ -250,6 +257,7 @@ class ReportingMixin:
cat = classify(base_type, name)
prec = precedence_index.get(cat, 999)
# Alphabetical within category (no mana value sorting)
owned_flag = 'Y' if (name.lower() in owned_set_lower) else ''
rows.append(((prec, name.lower()), [
name,
info.get('Count',1),
@ -265,7 +273,8 @@ class ReportingMixin:
info.get('TriggerTag') or '',
info.get('Synergy') if info.get('Synergy') is not None else '',
tags_join,
text_field[:800] if isinstance(text_field, str) else str(text_field)[:800]
text_field[:800] if isinstance(text_field, str) else str(text_field)[:800],
owned_flag
]))
# Now sort (category precedence, then alphabetical name)
rows.sort(key=lambda x: x[0])