feat: Implement game restart, battlefield styling with art crops and tapped stacks, and initial draw fixes.
Some checks failed
Build and Deploy / build (push) Failing after 1m10s
Some checks failed
Build and Deploy / build (push) Failing after 1m10s
This commit is contained in:
23
docs/development/devlog/2025-12-18-204000_cache_art_crops.md
Normal file
23
docs/development/devlog/2025-12-18-204000_cache_art_crops.md
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
title: Cache Art Crops
|
||||
status: 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.jpg` files.
|
||||
- Update `PackGeneratorService` (Client) to use local `.crop.jpg` URLs when `useLocalImages` is enabled.
|
||||
|
||||
## Implementation Details
|
||||
1. **Server (`CardService.ts`)**:
|
||||
- Modified `cacheImages` loop to detect if `image_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`.
|
||||
|
||||
2. **Client (`PackGeneratorService.ts`)**:
|
||||
- Updated `processCards` to check the `useLocalImages` flag.
|
||||
- If true, constructs the `imageArtCrop` URL using the local server path: `${origin}/cards/images/${set}/${id}.crop.jpg`.
|
||||
|
||||
## 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.
|
||||
Reference in New Issue
Block a user