Skip to content

Auto-derive and download multi-faced card images#8649

Merged
NoahTheDuke merged 1 commit intomtgred:masterfrom
xdg-forks:download-faces
Apr 2, 2026
Merged

Auto-derive and download multi-faced card images#8649
NoahTheDuke merged 1 commit intomtgred:masterfrom
xdg-forks:download-faces

Conversation

@xdg
Copy link
Copy Markdown
Contributor

@xdg xdg commented Mar 24, 2026

Replace the hardcoded cards-to-skip set with a system that auto-derives face-name-to-NRDB-index mappings from card data (:named-faces + :faces) and downloads face images separately. Manual overrides remain for cards where auto-derivation fails (SYNC, Earth Station).

Testing: this successfully downloaded the Melies card faces and did not attempt to re-download faces already committed to the repo.

Usually caveat of AI-assisted code, so please double check if this is idiomatic for the codebase.

Replace the hardcoded cards-to-skip set with a system that auto-derives
face-name-to-NRDB-index mappings from card data (:named-faces + :faces)
and downloads face images separately. Manual overrides remain for cards
where auto-derivation fails (SYNC, Earth Station).

Co-Authored-By: Claude <noreply@anthropic.com>
Comment thread src/clj/tasks/nrdb.clj
(defn- download-face-image
"Download a single face image from NRDB"
[{:keys [url file]}]
(binding [org.httpkit.client/*default-client* sni-client/default-client]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Comment thread src/clj/tasks/nrdb.clj
image (ImageIO/read input-stream)
path (.getPath file)]
(io/make-parents path)
(ImageIO/write image "png" (File. path)))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? Aren't we just ripping the file directly from the server?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the other change just mirror download-card-image in the same file. I didn't refactor to keep the PR simpler.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thanks, my bad for not knowing the existing code.

@NoahTheDuke NoahTheDuke merged commit 231f1db into mtgred:master Apr 2, 2026
3 checks passed
@xdg xdg deleted the download-faces branch April 3, 2026 02:58
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.

2 participants