feat: Card Kingdom prices, shopping cart export, and hover panel fixes (#73)

* feat: add CK prices, shopping cart export, and hover panel fixes

* fix: include commander in Buy This Deck cart export
This commit is contained in:
mwisnowski 2026-04-04 19:59:03 -07:00 committed by GitHub
parent dd996939e6
commit 69d84cc414
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 899 additions and 146 deletions

View file

@ -897,9 +897,17 @@ class ReportingMixin:
headers = [
"Name","Count","Type","ManaCost","ManaValue","Colors","Power","Toughness",
"Role","SubRole","AddedBy","TriggerTag","Synergy","Tags","MetadataTags","Text","DFCNote","Owned","Price"
"Role","SubRole","AddedBy","TriggerTag","Synergy","Tags","MetadataTags","Text","DFCNote","Owned","Price (TCGPlayer)"
]
# Auto-inject price service when running in the web context
if price_lookup is None:
try:
from code.web.services.price_service import get_price_service
price_lookup = get_price_service().get_prices_batch
except Exception:
pass
# Batch price lookup (no-op when price_lookup not provided)
card_names_list = list(self.card_library.keys())
prices_map: Dict[str, Any] = {}
@ -1068,7 +1076,7 @@ class ReportingMixin:
total_price = sum(
v for v in prices_map.values() if v is not None
)
price_col_index = headers.index('Price')
price_col_index = headers.index('Price (TCGPlayer)')
summary_row = [''] * len(headers)
summary_row[0] = 'Total'
summary_row[price_col_index] = f'{total_price:.2f}'