Commit Graph

334 Commits

Author SHA1 Message Date
Georges-Antoine Assi
0d89c15f1b generate hltb correctly 2025-09-16 10:48:26 -04:00
Georges-Antoine Assi
4ed1d82a46 add platform checks 2025-09-15 10:28:32 -04:00
Georges-Antoine Assi
3c4113f8a8 Merge branch 'master' into flashpoint-metadata-handler 2025-09-11 21:27:48 -04:00
Michael Manganiello
336b3d58c1 fix: Database JSON array utils
Fix existing JSON array util `json_array_contains_value`, and add two
new utils: `json_array_contains_any` and `json_array_contains_all`.
These utils have been tested with arrays of strings and integers, on the
following database engine versions:

- PostgreSQL: 12, 13, 14, 15, 16, 17, 18
- MySQL: 8.0, 8.4, 9.0, 9.4
- MariaDB: 10.5, 10.6, 10.11, 11.4, 11.8, 12.0
2025-09-08 21:39:46 -03:00
Michael Manganiello
e4e3928d1b misc: Apply import sorting 2025-09-04 11:17:00 -03:00
Michael Manganiello
2a0b273955 fix: Invalidate fixture cache on file change
The cache for fixture files was being set without a TTL, which meant
that updates to the fixture files were not reflected in the cache.

This change saves the MD5 hash of the fixture file in a different key,
and compares it to the current hash of the file before deciding whether
to update the cache.

Fixes #2347
2025-08-30 20:38:32 -03:00
Georges-Antoine Assi
ef2546ec08 fix base handler filename 2025-08-27 12:40:16 -04:00
Georges-Antoine Assi
bf0d864d84 Add flashpoint as a metadata handler 2025-08-27 11:04:13 -04:00
Georges-Antoine Assi
dea606ad80 Merge pull request #2261 from rommapp/hash-largest-file
Always hash the largest file in compressed multi file roms
2025-08-13 13:21:59 -05:00
Georges-Antoine Assi
4936ea5121 changes from code review 2025-08-13 14:11:33 -04:00
Georges-Antoine Assi
8fb4769776 changes from code review 2025-08-13 14:03:45 -04:00
Georges-Antoine Assi
81a04e4ab4 Always hash the largest file in compressed multi file roms 2025-08-13 13:43:07 -04:00
Michael Manganiello
80291f4be1 misc: Move cache initialization to startup script
Guarantee that cache is initialized during startup, and only once,
instead of every time a `MetadataHandler` object is instantiated.

Also, improve logic to determine `fixtures` paths.
2025-08-13 12:26:15 -03:00
Georges-Antoine Assi
d005dba90b fix a bunch of shit 2025-08-09 11:16:12 -04:00
Michael Manganiello
ba21cbc1e1 misc: Separate tests folder from backend code
Create separate `tests/` folder for all tests. This will also simplify
not copying tests code into the Docker image.
2025-08-08 12:49:13 -03:00
Georges-Antoine Assi
c47be7240b changs from bot review 2025-08-07 18:15:49 -04:00
Georges-Antoine Assi
9e37d87610 fix complex game names 2025-08-07 18:02:04 -04:00
Georges-Antoine Assi
b247a5c5bb small tweaks 2025-08-07 17:39:57 -04:00
Georges-Antoine Assi
926fe26fd9 [exp] use cli 7z to cacl hash files 2025-08-07 13:12:32 -04:00
Michael Manganiello
097818d560 misc: Replace emoji dependency with constants
The `emoji` library has been removed, in favor of using constants for
the few emojis used in the codebase. This reduces memory usage, and
avoids calling `emojize` for Python to discover where to replace emojis
in pre-defined strings.
2025-08-07 09:50:14 -03:00
Georges-Antoine Assi
9fd1adbbfb fixup icon names 2025-07-24 23:20:07 -04:00
Georges-Antoine Assi
59a2e5d5aa move away from explicit LIST use 2025-07-24 16:41:17 -04:00
Georges-Antoine Assi
1bb33be803 more work migrating slugs 2025-07-24 09:30:57 -04:00
Georges-Antoine Assi
6ad0b3f5d1 Only run slug_lower once 2025-07-21 17:29:01 -04:00
Georges-Antoine Assi
3372b754fe Group generated platforms by slug and filter by name 2025-07-21 17:22:16 -04:00
Georges-Antoine Assi
51652d5084 make all path stuff async 2025-07-18 10:53:55 -04:00
Georges-Antoine Assi
cfe848e14a load all igsb platform data into app 2025-07-13 14:59:54 -04:00
Georges-Antoine Assi
b11845242b use images for suported platforms 2025-07-09 16:10:37 -04:00
Georges-Antoine Assi
75b6ca9277 fix generating supported platforms 2025-07-09 15:57:48 -04:00
Georges-Antoine Assi
837d36375d Fix metadata issues in heasheous handler 2025-07-09 09:14:41 -04:00
Georges-Antoine Assi
e8f8f1621c complete migration to uv 2025-07-04 09:54:04 -04:00
Michael Manganiello
f96adeeaee misc: Upgrade to Python 3.13
Small changes to upgrade Python to version 3.13, and fixes based on a
`pyupgrade` run using the `--py313-plus` flag.
2025-07-03 23:37:00 -03:00
Georges-Antoine Assi
6d16ca41cc have cursor fix small bugs 2025-07-03 09:46:39 -04:00
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
Georges-Antoine Assi
0609747c6c finish migration platforms 2025-06-16 14:13:23 -04:00
Georges-Antoine Assi
2e677decea Merge branch 'master' into romm-403 2025-06-09 17:20:17 -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
Georges-Antoine Assi
7627380cee fix tests and launchbox 2025-05-23 20:01:07 -04:00
Georges-Antoine Assi
32988a8c93 fix IDs and generate platforms 2025-05-23 14:50:56 -04:00
Georges-Antoine Assi
fd705e41ce add and store fake launchbox IDs 2025-05-23 14:13:19 -04:00
Georges-Antoine Assi
fcdfcadf61 [HOTFIX] Update content-disposition headers 2025-04-03 13:13:25 -04:00
Zurdi
881a1d158d Merge pull request #1523 from jamiecounsell/fix/mysql-json-contains
Fix MySQL json_contains Error by Converting Non-String Values to JSON Strings
2025-02-02 00:19:12 +01:00
Michael Manganiello
72a0d2b12b Add isort fixes 2025-02-01 20:13:59 -03:00
Jamie Counsell
570cb6efdf refactor based on PR feedback 2025-02-01 15:20:42 -05:00
Jamie Counsell
835def23cc coerse JSON contains args to str when using mysql 2025-01-21 13:54:04 -05:00
Michael Manganiello
b298da86d5 Merge pull request #1474 from rommapp/fix/socketio-json-dumps
fix: SocketIO JSON dumps with sane defaults
2025-01-12 02:34:09 -03:00
Michael Manganiello
d837070ad0 fix: SocketIO JSON dumps with sane defaults
Similar to how `engineio` provides a JSON-compatible module, this change
adds a custom JSON encoder with support for additional types.

Changing SocketIO's JSON module fixes the encoding issue when the
scanning process tried to send a datetime, failing and the frontend not
displaying the scanned game (commonly, when it had sibling games)
2025-01-12 00:41:15 -03:00
Michael Manganiello
6b9ff574f8 misc: Add typehints to safe type conversion functions 2025-01-11 23:18:09 -03:00
Georges-Antoine Assi
aacad9c697 [HOTFIX] Safe cast values to int for first_release_date 2025-01-11 19:37:39 -05:00
Georges-Antoine Assi
b4b0d3fb85 [HOTFIX] Safe cast values to float 2025-01-11 19:22:31 -05:00