Commit Graph
101 Commits
Author SHA1 Message Date
Georges-Antoine Assi 3088e4566c changes from self-view 2025-02-09 11:22:10 -05:00
Georges-Antoine Assi b829a54d9f fix trunk 2025-02-08 23:21:00 -05:00
Georges-Antoine Assi 88dc964ac4 Merge branch 'master' into romm-994 2025-02-08 21:28:38 -05:00
Georges-Antoine Assi c320c8924e pass through func.lower 2025-01-30 17:46:46 -05:00
Georges-Antoine Assi 79575b1b30 Merge branch 'master' into fix/username-case-insensitive 2025-01-30 17:44:06 -05: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 60ec728e55 add option for all 2025-01-28 21:34:57 -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 21d2ce951e more fixes to loading games 2025-01-27 22:29:38 -05:00
Georges-Antoine Assi 5a79200617 bunch o fixes 2025-01-27 21:29:22 -05:00
Georges-Antoine Assi 10fbead892 autogenerate cover art 2025-01-27 20:26:33 -05:00
Georges-Antoine Assi 5dbc1aae0b display virtual collections 2025-01-27 19:14:54 -05:00
Georges-Antoine Assi dbe4b71c7a super naive appraoch to loading virtual collections 2025-01-27 18:15:52 -05:00
Georges-Antoine Assi 2859ac04c8 fix pyright issues 2025-01-26 10:57:27 -05:00
Georges-Antoine Assi 4b087d9dcb fix issue with duplicate filename 2025-01-17 11:28:03 -05:00
Georges-Antoine Assi 477d99a6bf first batch of review fixes 2025-01-17 11:15:54 -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 f0049d79d0 fix: Case-insensitive username and email check
Move case-insensitivity to the database layer, for both `username` and
`email` fields.

Fixes #1486.
2025-01-13 23:21:55 -03:00
Georges-Antoine Assi d0ba1d6e19 [HOTFIX] Fix remove from continue playing 2025-01-12 14:32:44 -05:00
Michael Manganiello 7825bce7b8 fix: Use proper JSON contains function for PostgreSQL
Fix `json_array_contains_value` function to use the `@>` operator for
checking if a JSON array contains a value in PostgreSQL. This is
necessary because the `has_key` function only works for string values.

Also, remove `get_rom_collections` method, as it was doing the same
thing as `get_collections_by_rom_id`.

Fixes #1441.
2025-01-08 21:07:01 -03:00
Zurdi 41baa0cad4 Merge pull request #1412 from rommapp/feature/1082-continue-playing
feat: continue playing home section
2025-01-01 18:37:38 +01:00
Michael Manganiello 3f4a36a5ce feat: PostgreSQL compatibility
This change introduces PostgreSQL compatibility, by implementing the
following changes:

* Use `JSONB` instead of `JSON` for PostgreSQL databases. This is
  achieved by creating a custom `CustomJSON` type that uses `JSONB` on
  PostgreSQL and `JSON` on other databases, leveraging the variant
  mechanism of SQLAlchemy.
* Add `is_postgresql` function to check if the current database is
  PostgreSQL. Commonly used for migrations, but can be used to determine
  how to build queries based on the database engine.
* Add `json_array_contains_value` function to check if a JSON array
  includes a specific value. This function is needed as it's
  engine-specific.

Support for PostgreSQL is on a best-effort basis, and it relies on the
community for continued support and testing. The project's main database
is MariaDB.

Closes #667.
2024-12-31 12:36:33 -03:00
zurdi 32b1d41198 feat: last played section at home view 2024-12-30 22:28:18 +00:00
Georges-Antoine Assi 1952f80b87 fix the rest of the tests 2024-12-22 17:00:35 -05:00
Georges-Antoine Assi 2e4e557eef fixup running scans and loading 2024-12-21 12:06:37 -05:00
Georges-Antoine Assi de7f96b95b create rom_files during scan 2024-12-21 10:04:41 -05:00
Georges-Antoine Assi 55eee458a1 actaully complete backend 2024-12-21 00:37:37 -05:00
Georges-Antoine Assi 3fcce6606c complete updating the endpoints and models 2024-12-20 22:41:56 -05:00
Georges-Antoine Assi 49c50ad810 Move hash calc for roms to bacakground task 2024-12-19 22:21:51 -05:00
Georges-Antoine Assi cae4089ccf add email field 2024-12-09 19:57:13 -05:00
zurdi c6039ccff4 fix: correct filter condition for retrieving collections associated with a ROM ID 2024-12-05 16:16:34 +00:00
zurdi 014427e69f fix: update ROM deletion process to remove associated collections and streamline user data updates 2024-12-05 16:08:45 +00:00
Michael Manganiello 0a4c81d5c1 misc: Retrieve roms by filename from database in bulk during scan
The scanning process could try to fetch thousands of roms from the
database, one by one, which is very inefficient, especially when only a
few new roms are added to the library, as the overhead of database calls
is very high compared to metadata API calls.

This change introduces a new method in the roms handler to retrieve roms
by their file names in bulk, which is used during the scan process to
fetch a batch of roms at once, instead of one by one.

It also avoids the `@with_details` decorator when fetching roms during
the scanning process, as those details are not needed, and they were
adding unnecessary joins and data decoding.
2024-12-02 00:00:47 -03:00
zurdi a51dd03e1a Added full offline support and configurable logging level and API requests debug logs 2024-11-27 17:12:13 +00:00
Michael Manganiello eba2971ffb fix: Simplify query that validates new username already exists
Instead of fetching all users and checking if the new username is present
in the list, we can directly query the database for the username.
2024-10-14 01:10:31 -03:00
Ali Scissons 5acbdfdf8b add offset parameter to get_roms endpoint 2024-10-11 23:28:30 -05:00
Georges-Antoine Assi 9b6b19eb27 Merge branch 'master' into romm-829 2024-09-03 18:58:06 -04:00
Georges-Antoine Assi ae05c6be8c [ROMM-1154] fix setting main sibling 2024-09-01 22:11:49 -04:00
Georges-Antoine Assi efcc2badea connect to the backend 2024-08-29 18:03:55 -04:00
Georges-Antoine Assi e4816911d9 Better performance for large collections 2024-08-28 11:44:31 -04:00
Michael Manganiello a85c84a7d4 misc: Use single SQLAlchemy engine and session maker
As recommended by SQLAlchemy [1], this change makes a single
instantiation of the database engine and session maker, instead of one
entity per handler.

It also uses the provided `URL` constructor to better define the
database URL structure.

[1] https://docs.sqlalchemy.org/en/20/core/connections.html#basic-usage
2024-08-21 09:56:28 -03:00
Georges-Antoine Assi 5f0577b900 more cleanup 2024-08-09 00:17:11 -04:00
Georges-Antoine Assi 1ae9cd0b5a remove unneded code 2024-08-09 00:10:31 -04:00
Georges-Antoine Assi 3a1986f453 single lines for the virtual table 2024-08-08 23:27:31 -04:00
Georges-Antoine Assi cd54d902a7 create database view for sibling roms 2024-08-08 22:25:50 -04:00
Georges-Antoine Assi 141edf9d2e Merge pull request #1028 from rommapp/share-public-collections
Public collections
2024-07-25 22:38:21 -04:00
Georges-Antoine Assi ad3a588631 filter collections for each user 2024-07-25 19:53:44 -04:00
Georges-Antoine Assi 92b23656aa start making collecitons public 2024-07-25 13:49:43 -04:00