fix: uncomment variant filter and add variant to CSV export (#197)

Restores the commented-out `?variant=` query filter on GET /api/v2/cards
so callers can pass variant=0 for base cards or variant=N for a specific
refractor variant. Adds variant column to CSV output header and rows.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-04-07 19:31:48 -05:00
parent 19003215a3
commit ea36c40902

View File

@ -79,8 +79,8 @@ async def get_cards(
all_cards = all_cards.where(Card.pack == this_pack)
if value is not None:
all_cards = all_cards.where(Card.value == value)
# if variant is not None:
# all_cards = all_cards.where(Card.variant == variant)
if variant is not None:
all_cards = all_cards.where(Card.variant == variant)
if min_value is not None:
all_cards = all_cards.where(Card.value >= min_value)
if max_value is not None:
@ -114,8 +114,8 @@ async def get_cards(
if csv:
data_list = [
["id", "player", "cardset", "rarity", "team", "pack", "value"]
] # , 'variant']]
["id", "player", "cardset", "rarity", "team", "pack", "value", "variant"]
]
for line in all_cards:
data_list.append(
[
@ -125,7 +125,8 @@ async def get_cards(
line.player.rarity,
line.team.abbrev,
line.pack,
line.value, # line.variant
line.value,
line.variant,
]
)
return_val = DataFrame(data_list).to_csv(header=False, index=False)