Commit Graph

47 Commits

Author SHA1 Message Date
Georges-Antoine Assi
3fcce6606c complete updating the endpoints and models 2024-12-20 22:41:56 -05:00
Michael Manganiello
099f6e6fe2 misc: Remove unneeded Redis key for Twitch token expiration
The key `romm:twitch_token_expires_at` is not needed, as we already
set an expiration time for the token key itself. If the token is still
present in Redis, it is valid. If not, it means we either never fetched
it, or it was too close to expiration.

With this change, fetching the Twitch token makes a single Redis call
instead of two.
2024-12-13 14:33:56 -03:00
Michael Manganiello
09c32f2376 misc: Use async cache in IGDB handler
One of the only places we are still using the sync cache, can be easily
changed to use the async one.
2024-12-13 09:21:47 -03:00
zurdi
52ccd1c727 fixes based on unit testing 2024-12-02 11:20:40 +00:00
zurdi
6a7433e1f9 removed unnecessary video endpoint request 2024-11-28 16:12:05 +00:00
zurdi
cb5d2438d2 Merge remote-tracking branch 'origin/master' into feature/add-platform-info 2024-11-28 15:23:32 +00:00
zurdi
a29a14aefb normalized covers and logos 2024-11-28 15:23:20 +00:00
zurdi
be87d92cf7 fixed platform info migration and models 2024-11-28 12:28:29 +00:00
zurdi
06e524f650 Merge branch 'master' into feature/add-platform-info 2024-11-27 22:51:16 +00:00
zurdi
a51dd03e1a Added full offline support and configurable logging level and API requests debug logs 2024-11-27 17:12:13 +00:00
zurdi
80b7cc7333 added basic platform info from the igdb api call 2024-11-27 11:43:06 +00:00
Michael Manganiello
4ecbac73b3 Merge pull request #1300 from rommapp/fix/igdb-game-search-categories
fix: Consider more categories when matching IGDB games
2024-11-17 01:46:23 -03:00
Michael Manganiello
71ac92bfb6 fix: Consider IGDB alternatives when checking for exact match
IGDB provides alternative names for games, which we are currently not
considering when checking for an exact match.

This change starts considering alternative names, in addition to the
game's name and slug, when checking for an exact match.
2024-11-16 20:58:20 -03:00
Michael Manganiello
deaac348da fix: Consider more categories when matching IGDB games
This change includes more categories when matching IGDB games. While
testing, some games were incorrectly matched to the wrong game, and the
reason was that the game was a Port (e.g. `Arkanoid`, `Contra`,
`Double Dragon`, `Metal Gear` for NES), a Remake (e.g.
`Adventure Island` for NES), or a Remaster.
2024-11-16 20:44:41 -03:00
Michael Manganiello
009a436915 Merge pull request #1265 from rommapp/misc/initial-igdb-typehints
misc: Initial addition of IGDB typehints
2024-10-29 13:23:02 -03:00
Michael Manganiello
6410b6b981 Merge pull request #1263 from rommapp/fix/download-igdb-screenshot-right-aspect-ratio
fix: Download IGDB screenshots with right aspect ratio
2024-10-29 13:22:36 -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
752096451e fix: Download IGDB screenshots with right aspect ratio
The IGDB API provides screenshots in a 1280x720 resolution, when either
`screenshot_huge` or `720p` size values are used [1]. The
`screenshot_huge` uses `Lfill`, while `720p` uses `Fit` as the resizing
method.

That means that either `screenshot_huge` or `720p` will provide the
correct aspect ratio for 16:9 platforms. However, for platforms with a
different aspect ratio, we need to use the `720p` size value to get the
correct image instead of a cropped one.

Example:
- [`screenshot_huge`](https://images.igdb.com/igdb/image/upload/t_screenshot_huge/c77bodnkwu73gs2jwhw4.jpg)
- [`720p`](https://images.igdb.com/igdb/image/upload/t_720p/c77bodnkwu73gs2jwhw4.jpg)

[1] https://api-docs.igdb.com/#images
2024-10-26 18:26:00 -03:00
Michael Manganiello
0190566530 fix: Broken IGDB age rating image links
Some of the image links for IGDB age ratings were broken. This commit
fixes all of them.
2024-10-26 01:19:57 -03:00
Georges-Antoine Assi
6880d11a73 Merge branch 'master' into romm-1114 2024-09-21 12:30:39 -04:00
Georges-Antoine Assi
6cb332efcf changes from reciew 2024-09-21 12:23:23 -04:00
Georges-Antoine Assi
2765a6e2c3 [ROMM-1176] Fetch video ID and place in carousel 2024-09-08 23:47:25 -04:00
Georges-Antoine Assi
e432bc32ac Merge branch 'master' into romm-1114 2024-09-03 19:13:33 -04:00
Georges-Antoine Assi
0ce3549f98 [ROMM-1123] Limit returned roms to 2500 2024-09-01 09:55:25 -04:00
Georges-Antoine Assi
c3ea419c68 Add age ratings to UI + filters 2024-08-26 15:55:45 -04:00
Michael Manganiello
0fdbbe4625 misc: Upgrade Python to v3.12 and Alpine to v3.20
Included upgrades:
* Python: v3.12
* Alpine: v3.20 (which uses Python 3.12)
* nginx: v1.27.1
2024-08-15 20:14:32 -03:00
Michael Manganiello
749e4d65c1 misc: Use PYTEST_VERSION variable to detect Pytest runs
Pytest v8.2 introduced the `PYTEST_VERSION` environment variable [1],
that can be used to check if code is running from within a pytest run.

This way, we can avoid checking the loaded `sys` modules.

[1] https://docs.pytest.org/en/stable/changelog.html#id57
2024-07-27 12:03:44 -03:00
Michael Manganiello
9319081ff6 fix: Return early if IGDB finds an exact match
This improvement avoids extra IGDB API requests when a received Rom is
an exact match. It avoids up to 2 requests per Rom, when an exact match
is found.
2024-07-27 00:53:27 -03:00
Michael Manganiello
aced1f1ff2 misc: Migrate IGDBBaseHandler to async
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.
2024-07-26 21:19:01 -03:00
Georges-Antoine Assi
7555c0607a [ROMM-1025] Replace game-and-watch with g-and-w 2024-07-25 14:26:06 -04:00
Michael Manganiello
6eb8e6aeff misc: Add Redis async cache
Introduce an asynchronous Redis instance to be used in async functions.
Also, this change migrates most of the sync cache usage to the new async
cache.
2024-07-21 18:23:19 -03:00
zurdi
180c373e1e steamgridDB integration added 2024-06-26 17:36:02 +02:00
Georges-Antoine Assi
176c57c792 run trunk fmt 2024-06-23 18:17:19 -03:00
Michael Manganiello
33ac3ca56d misc: Apply changes generated by pyupgrade
Changes automatically made by
[`pyupgrade`](https://github.com/asottile/pyupgrade), using the
`--py311-plus` flag, to be compatible with Python 3.11.
2024-06-23 18:17:08 -03:00
Michael Manganiello
fc53d77a58 misc: Compile constant regular expressions
Improve efficiency on reusable regular expressions, by compiling them.
2024-06-23 00:36:22 -03:00
zurdi
43846e3583 added new version card 2024-06-17 17:47:25 +02:00
Zurdi
242dbb9da5 cover path migration to id 2024-06-17 13:45:35 +02:00
Zurdi
b5383d3cb2 fixed getting 1080p cover from manual search 2024-06-16 18:35:37 +02:00
Zurdi
cf38949a65 fetch 1080p cover and huge screenshots 2024-06-15 16:58:13 +02:00
Georges-Antoine Assi
fcb34f9088 Merge branch 'master' into trunk-io 2024-05-23 10:06:13 -04:00
Georges-Antoine Assi
1840390c8a finish mypy fixes 2024-05-21 21:28:17 -04:00
Georges-Antoine Assi
b2085f87a8 bunch of fixes for trunk 2024-05-21 17:10:11 -04:00
Georges-Antoine Assi
a7cf0d389a run trunk format on all files 2024-05-21 10:18:13 -04:00
Georges-Antoine Assi
7b61972401 Fix search by ID for mobygames 2024-05-21 10:00:35 -04:00
Georges-Antoine Assi
2749aaee4a rename back to old names 2024-05-05 16:59:30 -04:00
Georges-Antoine Assi
dc33054ba1 more name refactoring 2024-05-05 16:45:58 -04:00
Georges-Antoine Assi
9ad28f3294 more refactoring again 2024-05-05 16:32:40 -04:00