Commit Graph

24 Commits

Author SHA1 Message Date
Michael Manganiello
252722e3bc misc: Apply pyupgrade changes for Python 3.12 compatibility
Command applied:
```
find ./backend/ -type f -name "*.py" -exec pyupgrade --py312-plus {} \;
```
2025-06-29 12:27:16 -03:00
Michael Manganiello
4209ee4481 misc: Create MobyGames service adapter
Add a new service adapter for the MobyGames API, to separate concerns
with RomM's handler for metadata.

This adapter is agnostic to the handler and only provides methods to
interact with the API, and correctly return typed responses.
2025-06-27 01:15:49 -03:00
Michael Manganiello
bf9fb12f91 misc: Create SteamGridDB service adapter
Add a new service adapter for the SteamGridDB API, to separate
concerns with RomM's handler for metadata.

This adapter is agnostic to the handler and only provides methods to
interact with the API, and correctly return typed responses.
2025-06-25 09:42:32 -03:00
Michael Manganiello
da8e7fd90c misc: Create ScreenScraper service adapter
Add a new service adapter for the ScreenScraper API, to separate
concerns with RomM's handler for metadata.

This adapter is agnostic to the handler and only provides methods to
interact with the API, and correctly return typed responses.
2025-06-19 10:17:27 -03:00
Georges-Antoine Assi
56117e8105 really fix it this time 2025-06-13 22:27:36 -04:00
Georges-Antoine Assi
5e6229a59d Fix RA platform IDs for matching 2025-06-11 08:51:47 -04:00
Michael Manganiello
a44db9767a fix: Iterate through user completion progress in RetroAchievements
Iterate through all pages of user completion progress in the
RetroAchievements service, instead of limiting the data retrieval to the
first 500 results.
2025-06-09 19:19:39 -03:00
Michael Manganiello
6768e25321 Merge pull request #1956 from rommapp/fix/retroachievements-api-use-aiohttp
fix: Use aiohttp for RetroAchievements API calls
2025-06-09 14:51:10 -03:00
Georges-Antoine Assi
d18f85b943 Fix and uupdate more rahasher IDs 2025-06-09 10:18:50 -04:00
Georges-Antoine Assi
0abb41d9db Use correct ID for genesis/metadrive 2025-06-09 09:51:55 -04:00
Michael Manganiello
fe1a9ce2a7 fix: Use aiohttp for RetroAchievements API calls
This change replaces the `httpx` client with `aiohttp` for the
RetroAchievements API service.

The main reason for this change is that `httpx` has an unavoidable log
line with `INFO` level, which includes the request full URL, containing
the user's API key.

`httpx` has had an
[open discussion](https://github.com/encode/httpx/discussions/2765)
regarding this security issue for almost two years.

The change to `aiohttp` is painless, and would allow us to migrate more
of the codebase to it in the future, to avoid leaking sensitive
information in logs.
2025-06-09 09:59:56 -03:00
Michael Manganiello
e885586edb misc: Create RetroAchievements service adapter
Add a new service adapter for the RetroAchievements API, to separate
concerns with RomM's handler for metadata. This adapter is agnostic
to the handler and only provides methods to interact with the
API, and correctly return typed responses.

The API authorization was also improved to be handled by a specific
`httpx.Auth` class that sets the `y` parameter for each request.
2025-06-09 00:47:05 -03:00
Michael Manganiello
3f8baed220 misc: Add typing to RetroAchievements API responses
Include detailed type information for RetroAchievements API responses,
based on the official API documentation.
2025-06-07 17:56:29 -03:00
Georges-Antoine Assi
fd18d8e1c9 small tweaks from copilot comments 2025-06-06 12:12:38 -04:00
Georges-Antoine Assi
f87f403555 search for hash instead of matching 2025-06-05 23:12:55 -04:00
Georges-Antoine Assi
8c817c7f4b stop RA from crashing when not available 2025-06-05 11:44:47 -04:00
zurdi
9be404da89 fix: little fix when RAHasher fails 2025-05-14 15:34:22 +00:00
zurdi
9d7fdf10dd refactor: enhance logging setup in logger.py and improve debug output in rahasher.py 2025-05-10 22:34:51 +00:00
zurdi
6da852ae58 refactor: update RAHasherService to use platform ID and improve hash calculation logic 2025-05-10 22:16:29 +00:00
zurdi
910dea3470 feat: integrate RAHasher for retroachievement hash calculation and improve UI responsiveness 2025-05-10 21:55:12 +00:00
zurdi
53d4761547 misc: migrate IGDB API fields to new version 2025-02-18 17:10:09 +00:00
Michael Manganiello
d62a8b4f8b misc: Add more IGDB typehints
Add more typehints for IGDB entities, including `GameTimeToBeat`.
2024-11-18 17:51:40 -03:00
Michael Manganiello
4bb5cb5149 misc: Initial addition of IGDB typehints
The short-term goal is to completely typehint the IGDB API responses. This
first change adds the base structures and enums RomM currently uses.

The `ExpandableField` type will allow us to model the expansion
mechanism the IGDB API provides, where a field can include either an ID,
or the full nested structure.
2024-10-27 00:02:01 -03:00
Michael Manganiello
a82489a9c4 feat: Add RAHasher and util to calculate RetroAchievements hashes
Build and include the `RAHasher` binary in the Docker image, to
calculate hashes for RetroAchievements. Also, add a service to
run `RAHasher` from Python.

Example usage:

```python
from adapters.services.rahasher import RAHasherError, RAHasherService

rahasher = RAHasherService()
try:
    hash = await rahasher.calculate_hash("nes", Path("path/to/rom.nes"))
except RAHasherError:
    # Handle error
    hash = None
```
2024-09-22 23:40:25 -03:00