ImageKeys: Fix image loading for sets with modern folder names#9429
Open
Dragynrain wants to merge 4 commits intoCard-Forge:masterfrom
Open
ImageKeys: Fix image loading for sets with modern folder names#9429Dragynrain wants to merge 4 commits intoCard-Forge:masterfrom
Dragynrain wants to merge 4 commits intoCard-Forge:masterfrom
Conversation
When images are downloaded via Scryfall, they are stored in folders using modern set codes (e.g., DST for Darksteel). However, the image lookup system only checked legacy Code2 folders (e.g., DS), causing images to not load on first access in Adventure mode shops. This fix extends hasImage() to check multiple folder locations: 1. Legacy Code2 folder (e.g., DS/) - checked first, wins for duplicates 2. Modern code folder (e.g., DST/) 3. Alias folder (if defined) The fix also handles mixed setups where images may be split across multiple folders, merging contents into the cache while preserving priority for existing legacy folder images. Fixes Card-Forge#9408
Contributor
Author
|
Anything I can do to get this moving along? |
Contributor
|
I don't really like adding more fallbacks I would prefer to clean up with a more cleaner design (see my other issues) |
Contributor
|
I think supporting fallback paths for the game's resources makes sense regardless of how it's organized later. If we change the storage location for images at a later date, we'd want a fallback regardless so that we don't force every user to redownload all their card images. Some users have countless images accumulated over time, others manually install hi-res image packs, others still use custom card images to reskin their cards. At minimum it'd be good to have fallback support, and ideally we'd want fallback support that migrates files to the new storage location automatically. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When images are downloaded via Scryfall, they are stored in folders using modern set codes (e.g., DST for Darksteel). However, the image lookup system only checked legacy Code2 folders (e.g., DS), causing images to not load on first access in Adventure mode shops.
This fix extends
hasImage()to check multiple folder locations:The fix also handles mixed setups where images may be split across multiple folders, merging contents into the cache while preserving priority for existing legacy folder images.
Fixes #9408
Test Plan