Commit Graph

66 Commits

Author SHA1 Message Date
Georges-Antoine Assi
ee8b55e6ef last set of changes 2026-03-07 09:56:17 -05:00
Georges-Antoine Assi
b3659a1226 changes from bot review 2026-03-07 08:58:42 -05:00
Georges-Antoine Assi
b030b98062 attempt to fix vuln reported in PR 2026-03-06 19:42:56 -05:00
Georges-Antoine Assi
827f787331 fix type issues 2026-03-06 17:17:11 -05:00
Georges-Antoine Assi
4bfd050a57 Merge branch 'master' into api-form-fields 2026-03-06 17:12:18 -05:00
Georges-Antoine Assi
6461078721 loosen rules around fetch matching screenshots 2026-02-19 10:18:56 -05:00
Georges-Antoine Assi
cef0ab0422 Update endpoints that use form data 2026-02-18 16:10:45 -05:00
Georges-Antoine Assi
6b1eda0828 fix bot review 2026-01-18 23:35:03 -05:00
Georges-Antoine Assi
bddb7bd9f5 manual cleanup 2026-01-18 22:27:46 -05:00
Georges-Antoine Assi
3ccc14d4a2 add endpoints for identifiers 2026-01-18 22:17:37 -05: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
Michael Manganiello
00d7815889 fix: Improve performance on asset screenshot retrieval
When retrieving the related screenshot for a `Save` or `State`, we were
retrieving a very heavy representation of the associated `Rom` object,
only to iterate through its screenshots to find the one we needed.

This change modifies the `Save` and `State` models to directly query the
`Screenshot` model, which is much faster and more efficient. The
`DBScreenshotsHandler` has been updated to include a new `filter` method
that will simplify building queries using SQLAlchemy, something we can
extend to other handlers in the future.

Fixes #1925.
2025-08-10 15:33:13 -03:00
Georges-Antoine Assi
51652d5084 make all path stuff async 2025-07-18 10:53:55 -04:00
Georges-Antoine Assi
aaf6741e93 Create safe filesystem handler 2025-07-17 12:30:57 -04:00
zurdi
0670d2a695 refactor: enhance error messages with highlighted file names and platform details 2025-05-14 16:36:03 +00:00
zurdi
44bfcaa23c fix: fixed assets path for screenshots 2025-05-14 16:28:46 +00:00
zurdi
48e3e09dd1 fix: build file path 2025-05-14 15:11:39 +00:00
zurdi
5f94440c9d Merge branch 'master' into refactor/saves-states-path 2025-05-14 13:35:28 +00:00
zurdi
6f08912fc0 refactor: remove unnecessary logging highlights and improve log messages for clarity 2025-05-09 10:25:11 +00:00
zurdi
14761c2c83 refactor: enhance logging with highlighted output for improved readability 2025-05-09 09:05:59 +00:00
Georges-Antoine Assi
d087266937 also add to states endpoint 2025-05-04 21:00:56 -04:00
zurdi
83cb0674c5 fix: include rom_id in file path building for saves and states 2025-04-25 16:54:36 +00:00
Georges-Antoine Assi
aa29f64ea2 fix assets test 2025-03-28 19:51:59 -04:00
Georges-Antoine Assi
d58691a79b always delete saves from fs + split delete dialogs 2025-03-27 23:37:42 -04:00
Georges-Antoine Assi
43f48899c9 add new endpoints to get some or all states and saves 2025-03-26 19:21:21 -04:00
Georges-Antoine Assi
c6d6a8100a wip refactor of save and state behaviour 2025-03-26 17:24:09 -04:00
Georges-Antoine Assi
7d54ef877b [HOTFIX] Remove single forward-slash endpoints 2025-02-11 13:48:24 -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
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
Georges-Antoine Assi
8fc25cde99 use timezone aware datetimes 2024-09-09 10:11:46 -04:00
Georges-Antoine Assi
48ec9f39a1 create ui components and page 2024-08-29 17:43:07 -04:00
Georges-Antoine Assi
5f27c1cf39 Create new fields on rom_user 2024-08-29 15:56:01 -04: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
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
eddc6456b3 fixes from trunk 2024-06-14 20:23:46 +02:00
zurdi
336f5aa76d fixed types from trunk check 2024-06-14 20:07:19 +02:00
zurdi
3c1e3b48a7 added upload/delete assets dialogs 2024-06-14 11:30:15 +02:00
zurdi
75d93ab564 fixed endpoints 2024-06-13 02:10:39 +02: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
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
Georges-Antoine Assi
feb175f02e General fixes for filtering assets per user 2024-02-07 20:31:03 -05:00