- Implemented RA hash handling in ROM processing.
- Added functionality to refresh RetroAchievements data for users.
- Updated user model to store RA progression data.
- Created a new component for managing RetroAchievements settings in user profiles.
- Enhanced ROM metadata to include merged RA achievements and badge paths.
- Refactored API calls to accommodate new RA features and removed unused API key handling.
- Updated frontend components to reflect changes in RA metadata and user settings.
- Adjusted Docker configuration for database service naming.
The previous implementation was calling `resize_cover_to_small` within
the context manager that was writing the image to the filesystem. This
was causing `PIL` to raise an error because it could not identify the
open and temporarily created file as a valid image.
Instead of saving the original image to the filesystem and then resizing
it, we now open the image in memory, resize it, and then save it to the
filesystem. We also avoid reading the `BytesIO` object twice by saving
small and big images from the same initial `Image` object.
Fixes#1191.
Convert `IGDBBaseHandler` methods to be asynchronous, and use an `httpx`
async client, instead of `requests` sync client.
This change also removes the direct dependency with `requests`, as the
project no longer uses it, preferring `httpx` instead.
For filesystem resource handler, `requests` calls have been replaced
with `httpx`, and file I/O has been replaced with `anyio` utils.
The existing approach to save covers and screenshots, by calling
`shutil.copyfileobj` with the raw response is no longer needed. `httpx`
does not provide a file-like object when streaming [1], so there's no
easy drop-in replacement.
However, the applied solution correctly builds the file iteratively, by
consuming the response in chunks.
[1] https://github.com/encode/httpx/discussions/2296