Commit Graph

115 Commits

Author SHA1 Message Date
Georges-Antoine Assi
a14a9bcf50 improve error msg 2025-02-24 20:36:21 -05:00
Georges-Antoine Assi
6932f864c6 reraise error 2025-02-24 19:52:35 -05:00
Georges-Antoine Assi
fd05737f6b [HOTFIX] Fix platform versions endpoint + run scans sync in DEV_MODE 2025-02-23 23:43:01 -05:00
zurdi
c9a92efcbc Enhance ROM identification logic by adding properties for partially and fully identified states 2025-02-18 00:25:08 +00:00
zurdi
c670136bf3 Merge remote-tracking branch 'origin/master' into feature/screenscraper-integration 2025-02-16 23:58:09 +00:00
Georges-Antoine Assi
8668714452 [ROMM-1616] Support custom icons for platform versions 2025-02-16 11:56:01 -05:00
zurdi
b37bd53ef7 Merge remote-tracking branch 'origin/master' into feature/screenscraper-integration 2025-02-16 16:43:34 +00:00
Georges-Antoine Assi
49aae2623c Reset stores on logout 2025-02-13 23:32:04 -05:00
zurdi
0660502f5a feat: screenscraper manual support 2025-02-06 18:53:23 +00:00
zurdi
9e213bc74d Refactor metadata source handling to use string types and update heartbeat store to include Screenscraper option 2025-02-06 10:14:30 +00:00
zurdi
d96239ca10 Refactor scan functions to use MetadataSource enum for metadata sources 2025-02-06 09:29:08 +00:00
Georges-Antoine Assi
8e5d4cdcb5 disable pyright 2025-01-26 11:29:33 -05:00
Georges-Antoine Assi
2859ac04c8 fix pyright issues 2025-01-26 10:57:27 -05:00
Georges-Antoine Assi
a35701396c Merge branch 'master' into rom-hashing-background-task 2025-01-25 23:30:15 -05:00
Georges-Antoine Assi
477d99a6bf first batch of review fixes 2025-01-17 11:15:54 -05:00
Georges-Antoine Assi
346bbb2db3 Add category column to rom file 2025-01-16 10:49:47 -05:00
Georges-Antoine Assi
84813bd962 Merge branch 'master' into rom-hashing-background-task 2024-12-27 12:02:04 -05:00
Georges-Antoine Assi
602c09e3d5 Merge branch 'master' into rom-hashing-background-task 2024-12-23 00:13:45 -05:00
Georges-Antoine Assi
bb7913ed0f fix migration file_path field 2024-12-22 13:55:54 -05:00
Georges-Antoine Assi
31aa6de128 fix storing each file location path 2024-12-21 16:44:08 -05:00
Georges-Antoine Assi
e8bd2a41dc add hash scan option to dropdown 2024-12-21 12:12:01 -05:00
Georges-Antoine Assi
2e4e557eef fixup running scans and loading 2024-12-21 12:06:37 -05:00
Georges-Antoine Assi
1da4d5b36b scan hashes indiv and as group 2024-12-21 10:43:59 -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
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
Michael Manganiello
00f75841f8 fix: Speed up scan for matched roms without filesystem changes
When the scanning process fiends that a rom should not be scanned, it
was still updating the rom data in the database.

This database update is only needed when the existing data is different
to the newly found filesystem data, so we can avoid most of the updates
for already existing library roms.
2024-12-01 17:35:46 -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
Georges-Antoine Assi
85443ae2d7 include the bullet in the first item 2024-11-16 14:17:32 -05:00
Georges-Antoine Assi
d01fe88db5 [ROMM-1292] Log when db entries are purged 2024-11-16 12:48:13 -05:00
Michael Manganiello
b81fbc5820 fix: Improve handling of Redis URL
This change replaces the creation of Redis URL, from a simple string
interpolation, to using `yarl.URL`. The main benefit, besides not
forgetting to set all five different variables on every Redis client
initialization, is that user credentials are correctly URL-encoded, if
present.

Up until now, if a password had special characters, it could break the
generated URL.

This change also introduces support for a `REDIS_SSL` setting, which
allows the user to specify if the Redis connection should use SSL or not.
2024-10-11 21:41:19 -03:00
Georges-Antoine Assi
b85b001c3b fix socket updates on scan 2024-09-21 11:15:32 -04:00
Georges-Antoine Assi
49e493802f Skip compressed files if theyre invalid 2024-08-18 14:14:38 -04:00
Georges-Antoine Assi
b3a50021b7 run quick before hash scan 2024-08-12 11:57:47 -04:00
Georges-Antoine Assi
e24a3b86bd Hotfix scans when running HASH_SCAN 2024-08-12 11:37:49 -04:00
Georges-Antoine Assi
56037070fb only calc hashes exlpicit 2024-08-11 19:36:52 -04:00
Georges-Antoine Assi
a4e162e2c1 Merge branch 'master' into calc-file-hashes-roms 2024-08-11 19:07:06 -04:00
Georges-Antoine Assi
90e0e688b7 Merge branch 'master' into calc-file-hashes-roms 2024-08-09 11:36:50 -04:00
Georges-Antoine Assi
3a1986f453 single lines for the virtual table 2024-08-08 23:27:31 -04:00
Georges-Antoine Assi
29bb08e43c [ROMM-1018] Fix scanning selected roms 2024-07-28 20:13:44 -04:00
Georges-Antoine Assi
9386ca9e4a changes from self-review 2024-07-27 16:31:32 -04:00
Georges-Antoine Assi
3a9cef24e0 get it all wokring 2024-07-27 13:30:52 -04:00
Georges-Antoine Assi
ecc021e824 Merge branch 'master' into calc-file-hashes-roms 2024-07-27 12:17:18 -04: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
Georges-Antoine Assi
efc0b75cdb Merge branch 'master' into calc-file-hashes-roms 2024-07-25 22:42:46 -04:00
Michael Manganiello
2bfc3c4c7e misc: Refactor scan process by splitting single function
This change mainly refactors the `scan_platforms` function, moving part
of its logic to `_identify_platform`, `_identify_firmware`, and
`_identify_rom`.

The logic is simpler this way, each smaller function returns `ScanStats`
that can be merged by the caller, and it simplifies future performance
improvements.
2024-07-25 10:29:46 -03: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
Michael Manganiello
7c6dfa8e50 feat: Use ContextVar to share httpx AsyncClient instance between requests 2024-07-23 01:29:32 -03:00