Commit Graph

92 Commits

Author SHA1 Message Date
zurdi
cfbcd82547 fix: changes based on review 2025-02-17 11:10:24 +00:00
zurdi
c33217bc24 Add ss_url_cover field to search response 2025-02-12 12:41:16 +00:00
zurdi
e51dfc3eec Merge remote-tracking branch 'origin/master' into feature/screenscraper-integration 2025-02-10 08:59:28 +00:00
Michael Manganiello
70825830c4 misc: Set prefix and tags to API routers
Improve OpenAPI documentation by setting tags to each API router. Also,
set a prefix to each router to group the endpoints by their
functionality.
2025-02-09 11:31:13 -03:00
zurdi
cb54ee3a23 fix: fixes from trunk 2025-02-04 12:41:49 +00:00
zurdi
9d96501b9e Merge remote-tracking branch 'origin/master' into feature/screenscraper-integration 2025-01-31 00:12:44 +00:00
Georges-Antoine Assi
9d8baef9de small tweaks from review 2025-01-15 22:54:35 -05:00
Georges-Antoine Assi
696a1c6122 Merge branch 'master' into rom-hashing-background-task 2025-01-15 21:51:23 -05:00
zurdi
a7a2e3b253 Merge remote-tracking branch 'origin/master' into feature/screenscraper-integration 2025-01-09 15:13:49 +00:00
Michael Manganiello
865370ec13 misc: Move auth constants to separate file
This simplifies avoiding circular imports when trying to use auth
handlers.
2025-01-08 22:16:31 -03:00
zurdi
23102b8aeb fix: trunk check 2025-01-06 13:32:28 +00:00
zurdi
e7342ab457 Merge remote-tracking branch 'origin/master' into feature/screenscraper-integration 2025-01-06 12:53:38 +00:00
Michael Manganiello
1c7cbc2328 misc: Change signature for get_matched_rom_by_id function
The previous function name `get_matched_roms_by_id` was misleading as it
returned a list of matched ROMs, but searching by ID should always
return either one result or none.
2025-01-05 15:18:19 -03:00
zurdi
a9f189bad4 Merge remote-tracking branch 'origin/master' into feature/screenscraper-integration 2025-01-05 16:49:37 +00:00
Michael Manganiello
81febf232f fix: Change rom_id type to int in search endpoint
Fixes PostgreSQL query error reported in:
https://github.com/rommapp/romm/issues/667#issuecomment-2571428721
2025-01-05 00:33:12 -03:00
zurdi
2c6a165e18 misc: improved manual match speed 2025-01-03 11:28:47 +00:00
zurdi
4aa2d49221 feat: fully integrated screenscrapper 2025-01-03 03:08:02 +00:00
zurdi
db4001dea0 feat: base structure for ss support 2025-01-02 10:34:10 +00:00
Georges-Antoine Assi
3fcce6606c complete updating the endpoints and models 2024-12-20 22:41:56 -05:00
zurdi
443def9cd9 Merge remote-tracking branch 'origin/master' into feature/screenscraper-integration 2024-12-10 11:40:44 +00:00
zurdi
b545d12731 improved aspect ratio set in gamecard 2024-12-02 11:03:01 +00:00
zurdi
95f064362a merge 'master' into feature/screenscraper-integration 2024-10-25 06:57:03 +00:00
zurdi
63fac78743 screenscraper API test 2024-10-25 01:05:58 +00:00
Michael Manganiello
beeb9f0c31 misc: Create enum for authorization scopes
Instead of using just strings, this change converts the scopes to a
`StrEnum`, to be compatible with places where a string is expected. This
avoids typos when using these scopes, simplifies searching for usages,
and improves type hints.

An extra change was the fix to the Firmware download endpoint, which
wasn't respecting the `DISABLE_DOWNLOAD_ENDPOINT_AUTH` flag.
2024-10-18 23:57:42 -03:00
Michael Manganiello
8abbae4c02 misc: Make backend handle URLs with trailing slash
According to multiple FastAPI discussions [1], FastAPI only includes a
built-in mechanism to redirect requests including a trailing slash, to
its variation without slash, using a `307` status code.

This can be an issue when certain clients do not send the same headers
on the redirected request.

This change adds a custom FastAPI `APIRouter`, that registers both route
path variations (with and without trailing slash), while only marking
the path without slash for being included in the OpenAPI schema.

[1] https://github.com/fastapi/fastapi/discussions/7298
2024-08-07 00:22:21 -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
Michael Manganiello
7c6dfa8e50 feat: Use ContextVar to share httpx AsyncClient instance between requests 2024-07-23 01:29:32 -03:00
Michael Manganiello
6d8a8714f5 misc: Migrate MobyGamesHandler to async
Convert `MobyGamesHandler` methods to be asynchronous, and use an
`httpx` async client, instead of `requests` sync client.
2024-07-22 01:09:36 -03:00
Michael Manganiello
b61bb11bce feat: Use async requests to retrieve SteamGridDB covers
This change avoids blocking requests when retrieving covers from
SteamGridDB, which is the main bottleneck as the current implementation
iterates over paginated results for multiple games.

Using an asynchronous client like `httpx` provides a good performance
improvement, and reduces the latency when calling this endpoint.
Also, the inclusion of FastAPI `lifespan` allows instantiating a single
client on startup.

When testing with "Final Fantasy V Advance", the endpoint goes from ~9s
to ~1.5s to retrieve all covers.
2024-07-09 22:37:14 -03:00
zurdi
f7b14b43d6 fixed everything from trunk 2024-07-09 13:43:14 +02:00
Zurdi
9a4283805c check steamgriddb api key on endpoint 2024-07-03 23:42:59 +02:00
Georges-Antoine Assi
7530fdd576 mega refactor of pr 2024-07-01 15:12:07 -04:00
zurdi
15f7522da5 rom db hanlder refactor to adapt to user_rom_props 2024-07-01 15:30:14 +02:00
Michael Manganiello
8281d5679b misc: Split database handler logic to get/list entities
The current implementation for some of the database handlers, where the
same method is used to retrieve either a single entity (when an `id` is
passed), a list of entities, or `None`, makes the typing and overall
design more complex.

This change simplifies database handlers, by having two separate methods
where appropiate:

* A method that receives an `id`, and returns either an entity, or `None`.
* A method that optionally receives filters, and returns (depending on
  the current handler implementation) a list of entities, or a `Select`
  object that allows chaining more SQLAlchemy operations.
2024-06-30 13:12:48 -03:00
zurdi
180c373e1e steamgridDB integration added 2024-06-26 17:36:02 +02:00
Zurdi
242dbb9da5 cover path migration to id 2024-06-17 13:45:35 +02:00
Georges-Antoine Assi
9b62641d55 Merge branch 'master' into trunk-io 2024-05-31 18:42:43 -04:00
Georges-Antoine Assi
b521af6266 run linter 2024-05-25 19:59:36 -04:00
Georges-Antoine Assi
2d21cd2b50 Improve speeds of rom fetch from DB 2024-05-25 19:47:36 -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
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
Georges-Antoine Assi
def2608c28 refactor db handlers 2024-05-05 15:46:07 -04:00
Georges-Antoine Assi
1a2c914045 refactor handlers out into own files 2024-05-05 12:45:56 -04:00
zurdi
d58d6514d5 improved cover selection from multi-source 2024-04-11 16:21:49 +02:00
Georges-Antoine Assi
a573780a92 fix edge case with item not returning name 2024-04-04 09:48:54 -04:00
Georges-Antoine Assi
a3b5d509e9 fix manual and scan moby search 2024-03-21 09:58:35 -04:00