Commit Graph

92 Commits

Author SHA1 Message Date
zurdi
171ee954c8 Merge remote-tracking branch 'origin/master' into refactor/saves-states-path 2025-05-16 17:13:35 +00:00
Georges-Antoine Assi
b9b6e17fd0 Merge pull request #1891 from ianfhunter/patch-1
During a scan, if an image fails to be read, the scan is aborted
2025-05-15 09:33:00 -04:00
Georges-Antoine Assi
9f27c81f73 run trunk check 2025-05-15 09:30:11 -04:00
Ian Hunter
6a52d43169 Update resources_handler.py 2025-05-15 12:28:15 +01:00
zurdi
44bfcaa23c fix: fixed assets path for screenshots 2025-05-14 16:28:46 +00:00
zurdi
5f94440c9d Merge branch 'master' into refactor/saves-states-path 2025-05-14 13:35:28 +00:00
zurdi
6da852ae58 refactor: update RAHasherService to use platform ID and improve hash calculation logic 2025-05-10 22:16:29 +00:00
zurdi
910dea3470 feat: integrate RAHasher for retroachievement hash calculation and improve UI responsiveness 2025-05-10 21:55:12 +00:00
zurdi
e270889aa5 Merge branch 'fix/reduce-ram-usage' into feature/retroachievements 2025-05-09 17:02:04 +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
zurdi
83cb0674c5 fix: include rom_id in file path building for saves and states 2025-04-25 16:54:36 +00:00
zurdi
0c436d32d8 Merge remote-tracking branch 'origin/master' into feature/retroachievements 2025-04-24 16:40:22 +00:00
Georges-Antoine Assi
c2747c5185 file name matching should be reverse match 2025-04-23 14:24:24 -04:00
Georges-Antoine Assi
cc899b54e2 refactor exclude_files fnct 2025-04-23 13:52:11 -04:00
Georges-Antoine Assi
3aad6870e9 [ROMM-1849] Fix excluding files in multi-file ROM 2025-04-23 13:47:23 -04:00
zurdi
e17f6b44de feat: Add RetroAchievements integration and user profile syncing
- Implemented RA hash handling in ROM processing.
- Added functionality to refresh RetroAchievements data for users.
- Updated user model to store RA progression data.
- Created a new component for managing RetroAchievements settings in user profiles.
- Enhanced ROM metadata to include merged RA achievements and badge paths.
- Refactored API calls to accommodate new RA features and removed unused API key handling.
- Updated frontend components to reflect changes in RA metadata and user settings.
- Adjusted Docker configuration for database service naming.
2025-04-22 21:08:10 +00:00
Georges-Antoine Assi
2e3af8bfdd only log image errors during scan 2025-03-29 10:59:57 -04:00
zurdi
d2c2fe6f12 Merge remote-tracking branch 'origin/master' into feature/screenscraper-integration 2025-02-08 20:40:27 +00:00
Georges-Antoine Assi
630f6de2e4 [ROMM-1588] Skip hash calc on file not found/permission erros 2025-02-07 11:24:27 -05:00
zurdi
0660502f5a feat: screenscraper manual support 2025-02-06 18:53:23 +00:00
zurdi
9ae3b7da6f feat: added manuals to ss migration 2025-02-06 13:49:09 +00:00
Georges-Antoine Assi
346bbb2db3 Add category column to rom file 2025-01-16 10:49:47 -05:00
Georges-Antoine Assi
0bb938f912 fix scanning nested folders 2025-01-15 23:24:50 -05:00
Georges-Antoine Assi
84813bd962 Merge branch 'master' into rom-hashing-background-task 2024-12-27 12:02:04 -05:00
Michael Manganiello
e38819b916 misc: Use immutable types for constants 2024-12-25 15:49:18 -03:00
Georges-Antoine Assi
31aa6de128 fix storing each file location path 2024-12-21 16:44:08 -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
7bde4aee70 complete the rst of the files 2024-12-20 23:45:25 -05:00
Georges-Antoine Assi
3fcce6606c complete updating the endpoints and models 2024-12-20 22:41:56 -05:00
Michael Manganiello
bcaecbd311 misc: Sort roms in get_roms method
The `get_roms` method is used during scanning and to generate feeds.
Sorting by filename is not perfect (e.g. prefixes like "The" or "A"),
but should be good enough for users to better visualize how the scanning
process is going, and how close it's to finish.
2024-12-13 10:01:49 -03:00
Michael Manganiello
477d9b1744 feat: Add streaming support for 7zip hashing
At the moment, 7zip files are generating memory issues and even OOM
errors on user installations. This is because the current stable release
of `py7zr` does not support decompression streaming, and RomM needs to
decompress the each 7zip file in the library into memory to be able to
calculate hashes.

This change introduces a `py7zr` fork I created to have a stable commit
SHA to refer to in case upstream gets any forced pushes. It includes the
contents of the pull request the `py7zr` creator is working on to
support decompression streaming [1].

The way decompression streaming is implemented in `py7zr` is different
than the other compression utilities. Instead of being able to provide a
`bytes` iterator, we need to provide a `Py7zIO` implementation that
will call a callback on each read and write operation.

[1] https://github.com/miurahr/py7zr/pull/620
2024-11-08 21:31:11 -03:00
Michael Manganiello
8fd680ab84 fix: Make tar decompression only consider regular files
The `tar` decompression function was failing for some users, with error
message:

```
'NoneType' object does not support the context manager protocol
```

As explained in the official documentation [1], the `extractfile` method
returns `None` if the member is not a regular file or a link. This
change skips any member that is not a regular file.

[1] https://docs.python.org/3/library/tarfile.html#tarfile.TarFile.extractfile
2024-10-26 01:07:27 -03:00
Michael Manganiello
a9ac322618 fix: Correctly resize and save small artwork
The previous implementation was calling `resize_cover_to_small` within
the context manager that was writing the image to the filesystem. This
was causing `PIL` to raise an error because it could not identify the
open and temporarily created file as a valid image.

Instead of saving the original image to the filesystem and then resizing
it, we now open the image in memory, resize it, and then save it to the
filesystem. We also avoid reading the `BytesIO` object twice by saving
small and big images from the same initial `Image` object.

Fixes #1191.
2024-10-12 00:55:06 -03:00
Michael Manganiello
149098fb31 fix: Improve memory usage during 7zip decompression
This change improves memory usage, by only keeping a single archive's
member file in memory at a time during 7zip decompression.

The `py7zr` library does not support streaming decompression yet, so
this change is the best we can do for now.

Potential fix for #1211, but it won't improve memory usage for
single-file 7zip archives.
2024-10-06 20:18:49 -03:00
Georges-Antoine Assi
00c8771e22 [ROMM0-1155] Patch zipfil + catch more 7zip errors 2024-09-01 21:58:22 -04:00
Michael Manganiello
0fad8ac282 feat: Use nginx mod_zip to generate multi-file zip downloads
This change installs and configures the `mod_zip` nginx module [1],
which allows nginx to stream ZIP files directly.

It includes a workaround needed to correctly calculate CRC-32 values for
included files, by including a new `server` section listening at port
8081, only used for the file requests to be upstream subrequests that
correctly trigger the CRC-32 calculation logic.

Also, to be able to provide a `m3u` file generated on the fly, we add a
`/decode` endpoint fully implemented in nginx using NJS, which receives
a `value` URL param, and decodes it using base64. The decoded value is
returned as the response.

That way, the contents of the `m3u` file is base64-encoded, and set as
part of the response, for `mod_zip` to include it in the ZIP file.

[1] https://github.com/evanmiller/mod_zip
2024-08-20 22:39:33 -03:00
Georges-Antoine Assi
49e493802f Skip compressed files if theyre invalid 2024-08-18 14:14:38 -04:00
Michael Manganiello
0fdbbe4625 misc: Upgrade Python to v3.12 and Alpine to v3.20
Included upgrades:
* Python: v3.12
* Alpine: v3.20 (which uses Python 3.12)
* nginx: v1.27.1
2024-08-15 20:14:32 -03:00
Georges-Antoine Assi
bc08e05a19 changes from self review 2024-08-11 23:09:58 -04:00
Georges-Antoine Assi
1ea1b326d3 move hashes to rom model 2024-08-11 22:38:22 -04:00
Georges-Antoine Assi
56037070fb only calc hashes exlpicit 2024-08-11 19:36:52 -04:00
Georges-Antoine Assi
7e086cec67 fixes from code review 2024-08-11 19:06:16 -04:00
Georges-Antoine Assi
195b86b573 even more cleanup 2024-08-09 11:46:07 -04:00
Georges-Antoine Assi
f01f5ce5b5 trunk fixes 2024-07-27 16:38:57 -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