Commit Graph

59 Commits

Author SHA1 Message Date
mHe4am
495ef2f9f5 Fixes GHSA-v7c8-f6xc-rv9g & GHSA-5ghc-8wr3-788c by adding authorization checks for collection endpoints 2025-11-18 10:42:04 +02:00
Georges-Antoine Assi
e54fcac682 changes from bot reivew 2025-10-30 21:02:42 -04:00
Georges-Antoine Assi
c8cda0987d pass booleans on collection create as params 2025-10-29 18:29:38 -04:00
Georges-Antoine Assi
6ccae17eb3 stoer favorites on collection 2025-10-17 18:19:40 -04:00
Michael Manganiello
40326112bd misc: Improve API docs for Delete endpoints
Add more detailed descriptions for Delete endpoints.
2025-09-09 11:05:47 -03:00
Michael Manganiello
e4e3928d1b misc: Apply import sorting 2025-09-04 11:17:00 -03:00
Georges-Antoine Assi
0cc9789a12 fix get_scalar_roms 2025-08-19 23:40:23 -04:00
Georges-Antoine Assi
cde0c0681f changes from review 2025-08-19 17:07:05 -04:00
Georges-Antoine Assi
0dadf8681e fix updating smart collections 2025-08-19 15:53:03 -04:00
Georges-Antoine Assi
159e2fac13 run trunk chck 2025-08-17 16:51:37 -04:00
Georges-Antoine Assi
5faa010e96 Only update specific values on models during scan 2025-08-17 16:42:27 -04:00
Georges-Antoine Assi
0acc9de6e6 add endpoint to fetch task result 2025-08-02 15:25:44 -04:00
Georges-Antoine Assi
7fba92588d get rid of delete response 2025-08-02 14:39:33 -04:00
Georges-Antoine Assi
70fe56296b Replace MessageResponse with spcific responses 2025-08-02 13:42:35 -04:00
Georges-Antoine Assi
1a57ff2c6b complete cycle of creation 2025-07-25 17:24:38 -04:00
Georges-Antoine Assi
f7b030ba10 get backend working sorta 2025-07-22 18:10:12 -04:00
Georges-Antoine Assi
75b8181451 start work on smart collections 2025-07-22 15:49:43 -04:00
Georges-Antoine Assi
73545ffa97 [HOTFIX] Fix uploading cover art manually 2025-07-18 23:32:17 -04:00
Georges-Antoine Assi
51652d5084 make all path stuff async 2025-07-18 10:53:55 -04:00
Georges-Antoine Assi
0d95735351 finish updating endpoints 2025-07-17 14:44:13 -04:00
zurdi
910dea3470 feat: integrate RAHasher for retroachievement hash calculation and improve UI responsiveness 2025-05-10 21:55:12 +00:00
zurdi
14761c2c83 refactor: enhance logging with highlighted output for improved readability 2025-05-09 09:05:59 +00:00
zurdi
2e3858d032 Merge branch 'master' into feature/screenscraper-integration 2025-02-12 12:41:08 +00:00
Georges-Antoine Assi
7d54ef877b [HOTFIX] Remove single forward-slash endpoints 2025-02-11 13:48:24 -05:00
zurdi
e51dfc3eec Merge remote-tracking branch 'origin/master' into feature/screenscraper-integration 2025-02-10 08:59:28 +00:00
Georges-Antoine Assi
75eb0374a2 fix bad merge 2025-02-09 20:38:04 -05:00
Georges-Antoine Assi
c9dcf5ba38 Merge branch 'master' into romm-994 2025-02-09 20:30:48 -05:00
Georges-Antoine Assi
3088e4566c changes from self-view 2025-02-09 11:22:10 -05: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
0660502f5a feat: screenscraper manual support 2025-02-06 18:53:23 +00:00
Georges-Antoine Assi
22e0c806e1 prefetch rom collections for details 2025-01-29 10:13:02 -05:00
Georges-Antoine Assi
cd724b7d1a migrate collections over to join table 2025-01-28 23:47:09 -05:00
Georges-Antoine Assi
f12ffdf685 add ui option to fetch/show virtual platforms 2025-01-28 11:10:21 -05:00
Georges-Antoine Assi
84c46c68eb autogen cover for collections 2025-01-27 22:20:52 -05:00
Georges-Antoine Assi
10fbead892 autogenerate cover art 2025-01-27 20:26:33 -05:00
Georges-Antoine Assi
dbe4b71c7a super naive appraoch to loading virtual collections 2025-01-27 18:15:52 -05: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
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
Georges-Antoine Assi
3fcce6606c complete updating the endpoints and models 2024-12-20 22:41:56 -05: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
a9ac322618 fix: Correctly resize and save small artwork
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.
2024-10-12 00:55:06 -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
d1fda9081f fix: Add missing awaits on read/write for async opened files 2024-07-27 00:38:05 -03:00
Michael Manganiello
c5b150c1eb fix: Enable flake8-async rules in ruff and fix warnings
`ASYNC` rules [1] tries to find issues regarding asynchronous code. This
change enables `ruff` to start reporting these issues, and fixes
existing warnings.

[1] https://docs.astral.sh/ruff/rules/#flake8-async-async
2024-07-26 21:40:46 -03:00
Georges-Antoine Assi
ad3a588631 filter collections for each user 2024-07-25 19:53:44 -04:00
Michael Manganiello
56066d6765 misc: Migrate filesystem resource handler to async
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
2024-07-24 00:18:17 -03:00
zurdi
884e7a35ac fixed re-download lost covers 2024-07-11 08:47:59 +02:00
zurdi
ec58ea9511 fixed custom cover 2024-07-08 11:49:09 +02:00
Zurdi
0bd4c6f704 fixed from PR comment 2024-07-04 19:09:01 +02:00