Commit Graph

9416 Commits

Author SHA1 Message Date
Georges-Antoine Assi
06eac10134 Merge pull request #3368 from rommapp/copilot/fix-ra-hashes-missing-ids
fix: include games without achievements in RA hash cache
2026-05-16 09:13:20 -04:00
Georges-Antoine Assi
9eecb67f0f Merge pull request #3369 from gtronset/gt-relative-gamelist-assets
Fix `gamelist.xml` export to use relative media paths for local exports
2026-05-16 09:04:26 -04:00
Georges-Antoine Assi
e92dbf060d run fmt 2026-05-16 08:58:20 -04:00
Georges-Antoine Assi
6f6d4c70ab Add integration tests for export_platform_to_file asset copying
Cover the local-export flow end to end: redirect resource and library
base paths into a tmp_path sandbox, run export_platform_to_file, and
assert that media files land at <platform>/assets/<subdir>/<rom>.<ext>
and that gamelist.xml references them. A second test withholds source
files to verify that failed copies omit their tags from the XML while
other assets still export.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 08:54:04 -04:00
Georges-Antoine Assi
4f03cdf03d Copy gamelist media into a local assets/ folder
Mirror the pegasus exporter pattern: collect each ROM's media into a
canonical asset-kind dict, then either copy the files under
<platform>/assets/<subdir>/ for local exports or build absolute URLs
from request.base_url for remote exports. Exclude the generated assets/
directory from filesystem scans.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 08:15:41 -04:00
Georges-Antoine Assi
f4227cafaf Build absolute resource URLs and simplify traversal check
Use URLPath.make_absolute_url with request.base_url to build resource
URLs for non-local exports, and simplify the local-export traversal
check with Path.is_relative_to.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 22:22:09 -04:00
Georges-Antoine Assi
1b164ee81b Merge pull request #3380 from EntropyEngineer/feature-gamelist-comma-separated-attributes
Add comma-separated metadata attribute support to gamelist
2026-05-15 21:15:08 -04:00
Georges-Antoine Assi
e7045446a8 run fmt 2026-05-15 21:01:33 -04:00
Entropy Engineer
4999214a92 Add comma-separated metadata attribute support to gamelist
Add comma-separated metadata attribute support to gamelist
2026-05-16 00:41:09 +05:00
Georges-Antoine Assi
32cdfb1547 Merge pull request #3374 from rommapp/copilot/fix-file-id-issue-api-call
Fix stale disc file ID in localStorage causing 404 on ROM play after rescan
2026-05-14 20:29:07 -04:00
Georges-Antoine Assi
de44d5be64 Merge pull request #3373 from rommapp/copilot/feature-disable-console-button
Apply `DISABLE_EMULATOR_JS` to Console mode (disable Play + block direct player route)
2026-05-14 15:50:35 -04:00
Georges-Antoine Assi
5b02d6b377 run fmt 2026-05-14 15:44:42 -04:00
Georges-Antoine Assi
3db3dd4434 run fmt 2026-05-14 15:41:32 -04:00
copilot-swe-agent[bot]
4ee310b0da fix(console): honor DISABLE_EMULATOR_JS in console mode
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/67bb960a-e5ec-4569-bdeb-d8c90028c004

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-05-14 18:40:25 +00:00
copilot-swe-agent[bot]
d1696cd047 Fix stale disc file_id causing 404 when playing ROMs after rescan
When a ROM is rescanned and its file IDs change, disc IDs stored in
localStorage become stale. This caused file_ids query params with invalid
IDs to be sent to /api/roms/{id}/content/{name}, resulting in 404 errors.

Validate the stored disc ID against the actual ROM files before use. If
stale, clear localStorage and fall back to the first available file.

Agent-Logs-Url: https://github.com/rommapp/romm/sessions/3579d577-13ff-4288-9a9c-909b6f891c9e

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-05-14 18:38:23 +00:00
copilot-swe-agent[bot]
df32c8a2d3 Initial plan 2026-05-14 18:30:37 +00:00
copilot-swe-agent[bot]
5ed8fae4fc Initial plan 2026-05-14 18:29:58 +00:00
Georges-Antoine Assi
c635ba5451 Merge pull request #3370 from rommapp/dependabot/uv/authlib-1.6.12
chore(deps): bump authlib from 1.6.9 to 1.6.12
2026-05-13 22:16:04 -04:00
dependabot[bot]
e6662e9968 chore(deps): bump authlib from 1.6.9 to 1.6.12
Bumps [authlib](https://github.com/authlib/authlib) from 1.6.9 to 1.6.12.
- [Release notes](https://github.com/authlib/authlib/releases)
- [Changelog](https://github.com/authlib/authlib/blob/1.6.12/docs/changelog.rst)
- [Commits](https://github.com/authlib/authlib/compare/v1.6.9...1.6.12)

---
updated-dependencies:
- dependency-name: authlib
  dependency-version: 1.6.12
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-14 00:22:55 +00:00
Gavin Tronset
4a2a4d6d38 PR feedback for tests and relpath validation 2026-05-13 15:23:54 -07:00
Gavin Tronset
b7a1dad960 Remove now-uneeded test and change import 2026-05-13 13:37:45 -07:00
Gavin Tronset
87f0cbd3de Fix YouTube URL and conditionally use relative 2026-05-13 13:37:45 -07:00
Gavin Tronset
17d5178586 Use relative paths for resources in gamelist exports 2026-05-13 13:37:45 -07:00
copilot-swe-agent[bot]
2c3335e8cf refactor: version RA hash cache and switch to O(1) hash-index format
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/f7097cd9-6bf4-42df-a14d-ff23e423291f

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-05-13 18:01:20 +00:00
Georges-Antoine Assi
c6a2f56fad Merge pull request #3367 from rommapp/regional-provider-tags
Prefer ROM's own region tag for ScreenScraper and IGDB artwork
2026-05-13 11:19:53 -04:00
copilot-swe-agent[bot]
157f719297 fix: include games without achievements in ra_hashes.json
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/d113d268-38fd-4564-892d-959fd5fddc68

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-05-13 15:17:47 +00:00
copilot-swe-agent[bot]
885747d085 Initial plan 2026-05-13 15:13:28 +00:00
Georges-Antoine Assi
8e009dffc0 render covers at their natural aspect ratio and drop the cover-style setting
Covers now use object-fit: contain inside a fixed slot, so each image
keeps its own aspect ratio (letterboxed where needed) instead of being
cropped to the platform's configured ratio. The slot itself still uses
a single default aspect ratio for grid stability, so cards don't reflow
as images load.

With per-platform aspect ratio no longer doing anything visible, remove
the Cover style picker from the platform info drawer and clean up dead
plumbing: galleryViewStore.getAspectRatio no longer reads
platform.aspect_ratio, platformId is dropped from Skeleton / SearchCover
/ MatchRom / showSearchCoverDialog, and the orphaned i18n keys
(cover-style, settings, old-squared-cases, old-horizontal-cases) are
stripped from all platform.json locale files.

Backend aspect_ratio column is left in place; no client sends it anymore.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 11:11:09 -04:00
Georges-Antoine Assi
c15038957a Merge pull request #3364 from rommapp/tolerate-forward-compat-config
Tolerate forward-compat values and malformed YAML in config loader
2026-05-13 10:22:26 -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
fd0ed1b22c cleanup 2026-05-13 08:56:28 -04:00
Georges-Antoine Assi
8210bab806 Tolerate forward-compat values and malformed YAML in config loader
Sample configs shipped with newer releases can reference media types or
options unknown to older versions; previously the loader called
sys.exit(3) and refused to boot. Now drop unknown scan.media entries,
fall back to defaults for unknown gamelist media thumbnail/image values,
and recover from YAML parse errors with a clear critical log instead of
a traceback. Type-mismatch validation still hard-fails since those are
real misconfigurations.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 22:26:43 -04:00
Georges-Antoine Assi
d87bf08074 Merge pull request #3362 from enlewof/master
Add exclude for images directory in config.batocera-retrobat.yml
2026-05-12 10:38:57 -04:00
Allen Lew
2c05abda61 Update config.batocera-retrobat.yml
Don't scan the images directory in games
2026-05-11 22:29:16 -07:00
Georges-Antoine Assi
effd081f90 Merge pull request #3286 from rommapp/local-lb-fix
Fix local LaunchBox handler: paths, arcade, videos, remote-match images
2026-05-09 14:46:35 -04:00
Georges-Antoine Assi
8999b66574 Preserve local LaunchBox data on UPDATE scans and video extensions
UPDATE scans with a known launchbox_id were calling get_rom_by_id(),
which only returns remote data and bypassed get_rom()'s local-first
merge — so local-only fields like Notes were getting clobbered and
local media matching fidelity dropped. get_rom_by_id() now optionally
takes fs_name/platform_slug and merges the local entry when its
DatabaseID matches the requested id.

Also fixes populate_rom_specific_paths writing every video as
video.mp4 regardless of source extension; since store_media_file is a
byte copy, .mkv/.webm contents would be served as .mp4 and break MIME
sniffing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 14:32:34 -04:00
Georges-Antoine Assi
d8ef6f0c05 Merge branch 'master' into local-lb-fix 2026-05-09 13:20:31 -04:00
Georges-Antoine Assi
547c64c4f5 update hltb api 2026-05-09 12:56:01 -04:00
Georges-Antoine Assi
d009662499 Merge pull request #3342 from rommapp/copilot/add-copy-default-config-yml
Auto-create missing `config.yml` on startup in mounted config volume
2026-05-09 11:00:22 -04:00
Georges-Antoine Assi
562ec51869 fix batocerya 2026-05-09 10:38:47 -04:00
Georges-Antoine Assi
796e9afd46 Merge pull request #3349 from enlewof/patch-1
Update config.batocera-retrobat.yml
2026-05-09 10:38:24 -04:00
Georges-Antoine Assi
f3b46d7bf3 Merge pull request #3353 from rommapp/validate-image-uploads
fix(backend): validate uploaded images with libmagic
2026-05-09 10:35:46 -04:00
Georges-Antoine Assi
e3aaa106a2 perf(backend): reuse libmagic instance for image upload validation
magic.Magic(mime=True) loads the magic database from disk on construction;
instantiating it per request was adding pointless overhead to every avatar
and artwork upload. Share a module-level instance guarded by a lock (the
underlying magic_t handle is not thread-safe), and surface MagicException
as a 400 so a sniffing failure fails closed instead of bubbling a 500.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 10:14:38 -04:00
Georges-Antoine Assi
783d9a257e test(backend): cover artwork upload validation for roms and collections
Adds rejection + acceptance tests for update_rom, add_collection, and
update_collection artwork uploads, mirroring the existing avatar tests:
non-image content returns 400, and a real PNG uploaded under a misleading
filename like payload.html is stored with the trusted .png extension.

Also fixes two `return HTTPException(...)` → `raise` in raw.py so the 404
path actually surfaces instead of silently returning the exception object.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 09:37:44 -04:00
Georges-Antoine Assi
53f14f5710 fix(backend): validate uploaded images with libmagic before storing
Avatar, ROM artwork, and collection artwork uploads now sniff the file
header with libmagic and reject anything that isn't PNG/JPEG/WebP/GIF,
saving the file with an extension derived from the detected MIME rather
than the user-supplied filename. Pairs with the raw asset endpoint,
which decides inline vs attachment from the on-disk extension.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 09:18:02 -04:00
Georges-Antoine Assi
cce678ed0b Merge pull request #3352 from rommapp/claude/eager-wing-a67e39
fix(frontend): use static auth background on Firefox
2026-05-09 09:08:50 -04:00
Georges-Antoine Assi
fe4546c8c1 fix(frontend): use static auth background on firefox
The animated SVG background causes lag on Firefox. Swap in the static
variant via @-moz-document url-prefix() so other engines keep the
animation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 09:05:58 -04:00
Georges-Antoine Assi
a5d13b1707 Merge pull request #3341 from rommapp/copilot/fix-checkbox-toggle-on-click
Setup wizard: make platform row click toggle selection checkbox
2026-05-09 08:47:47 -04:00
Georges-Antoine Assi
e6fb56a548 Merge pull request #3350 from rommapp/dependabot/npm_and_yarn/frontend/babel/plugin-transform-modules-systemjs-7.29.4
chore(deps-dev): bump @babel/plugin-transform-modules-systemjs from 7.29.0 to 7.29.4 in /frontend
2026-05-09 08:30:11 -04:00