Commit Graph

50 Commits

Author SHA1 Message Date
Georges-Antoine Assi
adb050f164 commit and push 2026-05-19 07:31:25 -04:00
Georges-Antoine Assi
757fafae5f feat(fs): hardlink import/export assets when possible, harden sync init
Importer (gamelist/launchbox file:// flows) and exporters (gamelist.xml,
metadata.pegasus.txt local exports) now hardlink media assets when source
and destination share a filesystem, falling back transparently to a copy
on EXDEV / EPERM / EOPNOTSUPP / EMLINK / EACCES (cross-device, FAT32,
exFAT, network mounts, etc.). Saves disk space and is effectively
instantaneous on large files (videos, manuals, miximages).

Covers keep a real copy (allow_link=False) because _store_cover resizes
the small cover in place via PIL.Image.save, which would truncate the
shared inode and corrupt the user's source image.

Also makes FSSyncHandler tolerate a missing/unwritable /romm/sync at
startup: an OSError from mkdir now logs a warning instead of crashing
the whole app at module-import time. Sync calls still fail at use time
if the mount remains broken — the right place to surface the error.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 07:38:11 -04:00
Georges-Antoine Assi
dad1250e15 case-insensitive region lookup for provider shortcode mapping
Rom.regions can contain raw filename text like "europe" or "EUROPE"
(filename parsing in roms_handler doesn't normalize casing), so the
direct dict lookup missed those tags and the locale silently fell back
to scan.priority.region. Replace the dict access with a helper that
lowercases both sides.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 09:34:10 -04:00
Georges-Antoine Assi
944514acc0 prefer rom's own region tag for ScreenScraper and IGDB artwork
When a ROM filename carries a region tag (e.g. (Europe)), use that
region first when picking artwork and localized titles, falling back to
the configured scan.priority.region. Previously the configured priority
was the only signal, so a US-first config would force US covers onto
European ROMs even when an EU asset was available.

Adds a shared name->provider-shortcode map and threads the rom through
the IGDB and SS lookup APIs so the rom-aware locale/region selection
can run for both providers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 09:06:11 -04:00
Georges-Antoine Assi
5e3a2707b0 cleanup 2026-05-03 19:39:19 -04:00
copilot-swe-agent[bot]
da005cf81a Optimize fnmatch check and use consistent n64 filename in test
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/8cbbc2ca-a3e3-4c61-9e47-f8544d59231a

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-05-03 23:36:23 +00:00
copilot-swe-agent[bot]
9593c30292 Address PR review: normalize exclusion sets, avoid duplicates, add multi-dot test for get_rom_files
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/8cbbc2ca-a3e3-4c61-9e47-f8544d59231a

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-05-03 23:34:30 +00:00
copilot-swe-agent[bot]
101629628e Simplify extension exclusion to use ends-with check instead of sub-extension iteration
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/a81b2023-a243-4721-bc5e-c6fa1a473a79

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-05-03 22:46:21 +00:00
copilot-swe-agent[bot]
55cd0cfc4f Support compound suffix exclusions like "hash.txt" for multi-dot filenames
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/d1c69638-bfa0-480e-8050-d565b234ea44

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-05-03 01:29:04 +00:00
copilot-swe-agent[bot]
21de7e21f8 Fix file exclusion for multi-dot filenames (e.g. game.nds.hash.txt)
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/2f711770-100b-4e9e-a66e-ab1a74f025f8

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-05-02 16:50:30 +00:00
Georges-Antoine Assi
2dc1678931 changes from bot review 2026-04-06 11:22:44 -04:00
Georges-Antoine Assi
5bf3a435ee moer fixes 2026-03-21 22:57:44 -04:00
Georges-Antoine Assi
8e8baef6f6 fix check 2026-03-21 22:52:23 -04:00
Georges-Antoine Assi
4536deff65 more twekas 2026-03-21 22:30:10 -04:00
Georges-Antoine Assi
ee8b55e6ef last set of changes 2026-03-07 09:56:17 -05:00
Georges-Antoine Assi
8a56e9b333 [ROMM-3026] Region/language shortcodes should be case sensitive 2026-02-18 10:19:12 -05:00
Georges-Antoine Assi
f48cf10e43 add more to fs error logs 2026-01-19 12:02:53 -05:00
zurdi
cc816822d8 Refactor library structure detection to use enum values and update related tests and frontend logic 2026-01-02 11:54:29 +00:00
Georges-Antoine Assi
dc52910a2a [ROMM-2774] Remove unsupported lang tags 2025-12-16 10:00:40 -05:00
Georges-Antoine Assi
c18cbc40c6 ignore case uuid regex 2025-11-17 11:25:23 -05:00
Georges-Antoine Assi
a9ecd8f714 [HOTFIX] Fix flashpoint match by UUID 2025-11-17 11:08:06 -05:00
Georges-Antoine Assi
d4e0f67c51 changes from bot review 2025-11-10 18:31:46 -05:00
Georges-Antoine Assi
eb5e32ed78 [HOTFIX] Fix importing media from gamelist.xml 2025-11-10 17:06:20 -05:00
Michael Manganiello
a6bdd84148 misc: Add missing language codes
This list was created based on latest DAT files from No-Intro and
Redump.org.

With all those extracted files in a folder, this command retrieved
language codes from filenames (only considering games with at least two
languages, to avoid false positives):

```shell
rg -N "^.*game name=\"(.*?)\".*" -r '$1' | \
    rg -N "^.* \(([A-Z][a-z](,[A-Z][a-z])+)\).*" -r '$1' | \
    rg -N -o "[A-Z][a-z]" | \
    sort | \
    uniq -c
```
2025-09-11 17:38:36 -03:00
Michael Manganiello
e4e3928d1b misc: Apply import sorting 2025-09-04 11:17:00 -03:00
Georges-Antoine Assi
774be0cbde [ROMM-2163] Fix excluding single roms without extensions 2025-08-12 18:18:29 -04:00
Georges-Antoine Assi
791939b65d [ROMM-2114] Fix using symlinks on volumes 2025-07-21 16:33:07 -04:00
Georges-Antoine Assi
af27ce15ad fix uploading user profile iamge 2025-07-19 09:53:44 -04:00
Georges-Antoine Assi
73545ffa97 [HOTFIX] Fix uploading cover art manually 2025-07-18 23:32:17 -04:00
Georges-Antoine Assi
31e8596f73 remove optional type 2025-07-18 11:49:49 -04:00
Georges-Antoine Assi
51652d5084 make all path stuff async 2025-07-18 10:53:55 -04:00
Georges-Antoine Assi
ff7fdbd9a4 fix moving files and folders 2025-07-17 21:31:27 -04:00
Georges-Antoine Assi
0df4eb1985 fix some aggressive usage 2025-07-17 21:20:02 -04:00
Georges-Antoine Assi
29fffb8833 add tests for base handler 2025-07-17 16:06:44 -04:00
Georges-Antoine Assi
48eab4c957 fix a bunch of tests 2025-07-17 15:48:46 -04:00
Georges-Antoine Assi
0d95735351 finish updating endpoints 2025-07-17 14:44:13 -04:00
Georges-Antoine Assi
bf9b4b3465 progress on resources handler 2025-07-17 13:00:37 -04:00
Georges-Antoine Assi
aaf6741e93 Create safe filesystem handler 2025-07-17 12:30:57 -04: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
Michael Manganiello
e38819b916 misc: Use immutable types for constants 2024-12-25 15:49:18 -03:00
Michael Manganiello
fc53d77a58 misc: Compile constant regular expressions
Improve efficiency on reusable regular expressions, by compiling them.
2024-06-23 00:36:22 -03:00
zurdi
ed67cfff12 fixed unit tests 2024-06-17 18:05:48 +02:00
Zurdi
242dbb9da5 cover path migration to id 2024-06-17 13:45:35 +02:00
Georges-Antoine Assi
1840390c8a finish mypy fixes 2024-05-21 21:28:17 -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
880345f20c ruff-only pre-commit 2024-05-18 12:05:57 -04:00
Georges-Antoine Assi
3e42f3ab56 also ignore firmware files on scan that match 2024-05-16 23:12:27 -04:00
Georges-Antoine Assi
9ad28f3294 more refactoring again 2024-05-05 16:32:40 -04:00