Skip to content

Add cdn_uuid per-set JSON files for Scryfall CDN image lookup#33

Open
phughk wants to merge 1 commit into
Card-Forge:mainfrom
phughk:fix-10413-cdn-uuid-data
Open

Add cdn_uuid per-set JSON files for Scryfall CDN image lookup#33
phughk wants to merge 1 commit into
Card-Forge:mainfrom
phughk:fix-10413-cdn-uuid-data

Conversation

@phughk

@phughk phughk commented Jun 10, 2026

Copy link
Copy Markdown

Problem

PR #10928 (the runtime CDN fetcher in Card-Forge/forge) needs a UUID for each card to construct non-rate-limited CDN URLs (cards.scryfall.io). Rather than bundling ~115k individual files with the game, the runtime fetches a single per-set JSON file on demand from this repository and caches it locally.

What this PR contains

1,041 JSON files under cdn_uuid/, one per Scryfall set code:

cdn_uuid/
├── neo.json     {"1":{"en":"…","ja":"…","pt":"…",...}, "2":{"en":"…"}, ...}
├── ltr.json
├── mh3.json
└── … (1,041 sets)

Each file maps collector numbers to per-language Scryfall UUIDs. DFCs with distinct face UUIDs store an array:

{"A-40": {"en": ["front-uuid", "back-uuid"]}}

How it was generated

Using the CLI tool from PR #10937 (Card-Forge/forge) against the Scryfall default-cards bulk-data snapshot (June 2026):

mvn -pl forge-scryfall-uuid-map exec:java \
  -Dexec.args="--output-dir cdn_uuid --default-cards"

How the runtime uses these files

On the first image lookup for a set, Forge fetches cdn_uuid/{setCode}.json from this repository via the GitHub raw content URL, writes it to {cacheDir}/cdn_uuid/{setCode}.json, and resolves all subsequent cards in that set from the local cache — no repeated network requests.

Sets not present here (added after this data was generated) fall back silently to the Scryfall API.

Depends on

PR #10928 in Card-Forge/forge — the runtime code that fetches and reads these files.

1,041 JSON files mapping (collector number, language) → Scryfall UUID for
every set in Scryfall's default-cards bulk export. The runtime fetches these
on demand from this repository and caches them locally so card images can be
resolved from the rate-free cards.scryfall.io CDN.

File format: cdn_uuid/{setCode}.json
  {"cn": {"lang": "uuid"}, ...}  — single-faced
  {"cn": {"lang": ["frontUuid","backUuid"]}, ...}  — DFCs with distinct faces

Generated from the Scryfall default-cards bulk export (June 2026) using the
forge-scryfall-uuid-map CLI tool (PR #10937 in Card-Forge/forge).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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