Skip to content

🐛 fix: homogenize basic-energy images on TCGdex sm1#648

Merged
jbourdin merged 1 commit into
developfrom
fix/basic-energy-images-tcgdex-sm1
May 28, 2026
Merged

🐛 fix: homogenize basic-energy images on TCGdex sm1#648
jbourdin merged 1 commit into
developfrom
fix/basic-energy-images-tcgdex-sm1

Conversation

@jbourdin
Copy link
Copy Markdown
Owner

Summary

  • CardEnricher::BASIC_ENERGY_IMAGES now points all 9 basic-energy fallback URLs at TCGdex sm1/164–172 (the only TCGdex-deployed set with every basic-energy color including Fairy). Single CDN, single artwork era, replaces the previous mix of assets.pokemon.com (MEE) + images.pokemontcg.io (sm1 Fairy hires).
  • New data migration Version20260528230443 heals already-enriched decks with two passes:
    • Narrow: matches the 9 exact pre-PR fallback URLs (synthetic energy-… printings).
    • Broad: JOINs card_printing on card_identity and remaps every printing whose set_code is one of the PTCG-Live energy-only codes (MEE/SVE/SME/XYE/BWE) and whose identity name is a basic-energy name. This catches rows that carried legacy SVE pokemon.com art or the 404-prone assets.tcgdex.net/en/me/mee/* URLs.
  • data/basic_energies.json — added TCGdex URLs to the 9 canonical sm1 entries (additive; defaultForMinified flags untouched).
  • docs/technicalities/basic_energy_images.md — clarifies the deliberate split between the image-fallback map (now sm1) and the minified-export defaults (still MEE — the setCode identifier is rendered on physical labels and is a separate decision).
  • Existing test testEnrichBasicEnergyCreatesSyntheticPrintingFromStaticMap updated to assert the new sm1 URL.

Visual tradeoff

Basic-energy art reverts from the 2025 MEE/SVE "Basic" banner artwork to the 2017 Sun & Moon base set artwork — the price of homogeneity today, since TCGdex still returns 404 for assets.tcgdex.net/en/sv/sve/* and assets.tcgdex.net/en/me/mee/* (re-verified 2026-05-28). Once TCGdex deploys MEE artwork, the 8 non-Fairy fallbacks can be moved back to modern art in a follow-up.

Out of scope

  • ENERGY_SET_IMAGES (the exact SVE|N / MEE|N map) is untouched — TCGdex still doesn't host that artwork.
  • DEFAULT_BASIC_ENERGY_PRINTINGS (minified export, mosaic, Cardmarket, printed labels) is untouched — its setCode identifier is user-visible on physical labels.

Test plan

  • make cs-fix clean
  • make phpstan 0 errors
  • make lint-yaml / lint-container / lint-i18n OK
  • make test.unit (1358 tests) green
  • make test.functional (1121 tests) green
  • make audit 0 vulnerabilities
  • Migration applies cleanly locally; 5 affected rows remapped to correct sm1 URL by color
  • Visual: deck-show page renders basic energies via assets.tcgdex.net/en/sm/sm1/…
  • Verified on a deck containing all 9 colors (Grass through Fairy)

CardEnricher::BASIC_ENERGY_IMAGES now points all 9 basic-energy fallbacks
at TCGdex sm1/164-172 (the only TCGdex-deployed set with all 9 colors
including Fairy). Single CDN, single artwork era — replaces the previous
mix of pokemon.com (MEE) and pokemontcg.io (sm1 Fairy) URLs.

A two-pass data migration heals already-enriched decks: a narrow URL
match for synthetic energy- fallback rows, plus a JOIN-based update for
real TCGdex printings tagged with PTCG Live energy-only set codes
(MEE/SVE/SME/XYE/BWE) — those carried legacy SVE pokemon.com art or the
404-prone assets.tcgdex.net/en/me/mee/* URLs and now map to sm1 by color.

DEFAULT_BASIC_ENERGY_PRINTINGS (minified export / printed labels) is
intentionally left unchanged — the MEE 1-8 setCode identifier is
user-visible on physical labels and a separate decision.
@sentry
Copy link
Copy Markdown

sentry Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jbourdin jbourdin merged commit 11e532a into develop May 28, 2026
6 checks passed
@jbourdin jbourdin deleted the fix/basic-energy-images-tcgdex-sm1 branch May 28, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant