ImageKeys: Fix image loading for sets with modern folder names#9429
ImageKeys: Fix image loading for sets with modern folder names#9429Dragynrain wants to merge 6 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
|
Anything I can do to get this moving along? |
|
I don't really like adding more fallbacks I would prefer to clean up with a more cleaner design (see my other issues) |
|
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. |
|
Anything I can do to move this along? |
|
The bigger question is why |
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