Commit Graph

78 Commits

Author SHA1 Message Date
Georges-Antoine Assi
51cd16634c add dedicated emulatorjs save quick button 2025-03-26 10:56:48 -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
2859ac04c8 fix pyright issues 2025-01-26 10:57:27 -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
84813bd962 Merge branch 'master' into rom-hashing-background-task 2024-12-27 12:02:04 -05:00
Georges-Antoine Assi
6c238a8955 use pydantic resolver to set name field on platform 2024-12-24 10:24:20 -05:00
zurdi
9645fab707 feat: Added custom name for platforms 2024-12-24 02:30:27 +00:00
Georges-Antoine Assi
3fcce6606c complete updating the endpoints and models 2024-12-20 22:41:56 -05:00
zurdi
ec41d72a8f set gameCard aspect ratio based on platform 2024-12-01 23:51:46 +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
Georges-Antoine Assi
8fc25cde99 use timezone aware datetimes 2024-09-09 10:11:46 -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
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
zurdi
1d6ba70080 collections get_roms endpoint added 2024-07-02 14:31:27 +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
zurdi
66e185db47 Merge branch 'master' into feature/fav_for_siblings 2024-07-01 08:34:04 +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
0a0bab6730 migrated rom_notes to user_rom_props 2024-06-29 11:26:16 +02:00
Zurdi
1454395c78 Update backend/endpoints/platform.py
Co-authored-by: Georges-Antoine Assi <3247106+gantoine@users.noreply.github.com>
2024-06-28 22:47:33 +02:00
Zurdi
1390cb1990 fixed datetime serialization on socketio dump 2024-06-28 19:14:02 +02:00
zurdi
a282384bb5 fixed platform error on gallery 2024-06-28 14:23:51 +02:00
zurdi
87d7eb51a5 fixed supported platforms endpoint 2024-06-28 12:31:31 +02:00
zurdi
4fe9abe418 refactor all configuration views 2024-06-12 20:07:32 +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
66510c0327 Improve fetch times of platforms endpoint 2024-05-18 17:24:07 -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
e64b6728b0 add endpoints for firmware 2024-05-01 17:38:12 -04:00
zurdi
d3864ff02b create platform if not exists when adding roms fixed 2024-04-11 01:39:58 +02:00
zurdi
c8db7681d3 added all supported platforms to upload rom dialog 2024-04-10 22:45:59 +02:00
Zurdi
b122e93db2 remove unused code 2024-04-09 13:48:29 +02:00
zurdi
df047cc5e9 upload roms button in drawer added 2024-04-08 18:31:02 +02:00
zurdi
d784928884 Merge branch 'mobygames-new-api' into feature/add_platform 2024-03-19 17:57:02 +01:00
Zurdi
ec0875b2aa return availability message for WIP endpoints 2024-03-10 11:17:09 +01:00
Zurdi
1af05d447b add platform endpoint added 2024-02-11 00:36:56 +01:00
Georges-Antoine Assi
81b5bcf9ba refactor handler names 2024-01-18 14:04:35 -05:00
Zurdi
cc0dffe5e6 fixed delete endpoints 2024-01-17 18:36:35 +01:00
Zurdi
42065aec7c backend refactor as RESTful 2024-01-15 13:34:18 +01:00
Zurdi
1d2c9e7d05 standarized GET endpoints for roms and platforms 2024-01-14 02:34:37 +01:00
Zurdi
93f6cb7651 Merge branch 'feature/manage_config_from_ui' into refactor/backend 2024-01-13 02:17:19 +01:00
Zurdi
4b9e76f550 backend structure refactor 2024-01-12 23:44:27 +01:00
Zurdi
33b6364c8a endpoints and responses restructured 2024-01-11 23:57:06 +01:00
Zurdi
de14ad09be webrdace moduled 2024-01-11 21:55:15 +01:00
Zurdi
47a83a525b config is loaded dinamycally and platform bindings can be removed from UI 2024-01-11 15:26:41 +01:00