mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2026-04-06 05:07:16 +02:00
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:
parent
dd996939e6
commit
69d84cc414
24 changed files with 899 additions and 146 deletions
|
|
@ -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}'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue