1.1 KiB
1.1 KiB
title, status
| title | status |
|---|---|
| Cache Art Crops | Completed |
Objectives
- Ensure "Art Crop" images are cached locally alongside "Normal" images to support offline mode and reduce external API calls.
- Update
CardService(Server) to download and save.crop.jpgfiles. - Update
PackGeneratorService(Client) to use local.crop.jpgURLs whenuseLocalImagesis enabled.
Implementation Details
-
Server (
CardService.ts):- Modified
cacheImagesloop to detect ifimage_uris.art_crop(or face equivalent) exists. - Implemented concurrent downloading of both the normal image and the art crop.
- Saves art crops with the pattern:
public/cards/images/[setCode]/[uuid].crop.jpg.
- Modified
-
Client (
PackGeneratorService.ts):- Updated
processCardsto check theuseLocalImagesflag. - If true, constructs the
imageArtCropURL using the local server path:${origin}/cards/images/${set}/${id}.crop.jpg.
- Updated
Impact
- When users import a cube or set collection, both image versions will now be stored.
- The Battlefield view (which uses
art_crop) will now load instantly from the local server cache instead of Scryfall.