1.3 KiB
1.3 KiB
2025-12-18 - Restrictive Cache Structure
Overview
Implemented strict separation of card assets into full and crop subdirectories nested under cards/[expansion-code]/. This update forces the application to depend entirely on the local cache for serving card images during runtime, fetching from Scryfall only during the explicit cache creation phase.
Changes
-
Refactored
CardService.ts:- Updated
cacheImagesto save files topublic/cards/[set]/full/[id].jpgandpublic/cards/[set]/crop/[id].jpg. - Removed the intermediate
imagesdirectory layer.
- Updated
-
Updated
PackGeneratorService.ts(Server):- Hardcoded
imageandimageArtCropproperties to point to the local server paths (/cards/[set]/full/[id].jpgetc.), removing the fallback to Scryfall URIs.
- Hardcoded
-
Updated
PackGeneratorService.ts(Client):- Aligned local image path generation with the new server structure (
/cards/[set]/...).
- Aligned local image path generation with the new server structure (
Rationale
To ensure offline availability and consistent performance, the application now treats the local cache as the authoritative source for images. This standardization simplifies asset management and prepares the system for strict air-gapped or high-performance environments where external API dependencies are undesirable during gameplay.