Commit Graph

80 Commits

Author SHA1 Message Date
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
Michael Manganiello
6d8a8714f5 misc: Migrate MobyGamesHandler to async
Convert `MobyGamesHandler` methods to be asynchronous, and use an
`httpx` async client, instead of `requests` sync client.
2024-07-22 01:09:36 -03:00
Georges-Antoine Assi
2b2ff875ee Calculate hashes for rom files 2024-07-15 18:27:29 -04:00
Georges-Antoine Assi
6ec091e5da [ROMM-1003] Fix aborting mid-scan 2024-07-15 13:08:52 -04:00
Georges-Antoine Assi
2445e3f643 Prevent mass purge of roms, firmware and platforms 2024-07-07 19:02:28 -04:00
zurdi
59c2a51a6f added collection cover management 2024-07-03 14:31:17 +02:00
zurdi
39708ff828 fixes from trunk 2024-07-03 10:03:55 +02:00
zurdi
2b6a86898a cleanup scan socket 2024-07-02 01:48:43 +02:00
Georges-Antoine Assi
7530fdd576 mega refactor of pr 2024-07-01 15:12:07 -04: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
1390cb1990 fixed datetime serialization on socketio dump 2024-06-28 19:14:02 +02:00
Georges-Antoine Assi
e2c5ba68cb backend tweaks + refactor 2024-06-18 23:21:17 -04:00
zurdi
d02d416f40 generate small version of custom cover 2024-06-18 14:20:49 +02:00
zurdi
84e442c0c5 cover path platform migrated to id 2024-06-18 01:24:19 +02:00
Zurdi
242dbb9da5 cover path migration to id 2024-06-17 13:45:35 +02:00
Georges-Antoine Assi
9b62641d55 Merge branch 'master' into trunk-io 2024-05-31 18:42:43 -04:00
Georges-Antoine Assi
63e58d3e15 [ROMM-867] Only scan platform when selected 2024-05-25 18:15:23 -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
f130ff3abc fix emujs player 2024-05-01 18:42:15 -04:00
Georges-Antoine Assi
eca1eb1136 model and scanning 2024-05-01 15:27:16 -04:00
Georges-Antoine Assi
0154ca098e Misc hotfixes from casuallynotes testing 2024-04-03 10:25:27 -04:00
Georges-Antoine Assi
16db9b03bc [HOTFIX] Fix nightly scans resetting igdb/moby IDs 2024-04-02 15:22:25 -04:00
Georges-Antoine Assi
716c77285f misc fixes 2024-03-26 19:42:33 -04:00
Georges-Antoine Assi
f1a2cfa7b4 add scan stats after finish 2024-03-15 22:17:34 -04:00
Georges-Antoine Assi
bd07c1d21f add button to stop running scan 2024-03-14 21:17:03 -04:00
Georges-Antoine Assi
899bd16ea9 changes from self review 2024-03-14 19:39:19 -04:00
Georges-Antoine Assi
40cc5199f7 Add more checks for providers disabled 2024-03-10 18:35:55 -04:00
Georges-Antoine Assi
41c85b3f80 Merge branch 'master' into mobygames-new-api 2024-03-10 18:05:02 -04:00
Georges-Antoine Assi
a1f79abf4b remove checks for connectivity 2024-03-08 12:22:17 -05:00
Zurdi
c2949ccb0a fixed check igdb credentials 2024-03-08 17:27:21 +01:00
zurdi
a4a5398c7f improved http exceptions when connection error 2024-03-08 13:42:04 +01:00