Commit Graph

9272 Commits

Author SHA1 Message Date
Georges-Antoine Assi
e8a6e9f01d final fixes 2026-04-12 18:43:24 -04:00
Georges-Antoine Assi
d45afb5dde more fixes 2026-04-12 18:32:15 -04:00
Georges-Antoine Assi
f2df03361e fix: cast spread-dict back to RAUserGameProgression to preserve typing
Pylance infers dict[str, Unknown] from the {**old, "highest_award_kind": ...}
spread, which then fails to assign to list[RAUserGameProgression]. Wrap in
typing.cast so the TypedDict type survives the reassignment.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 18:08:18 -04:00
Georges-Antoine Assi
628d8d8bae refactor: pass RAGamesPlatform dict into calculate_hash, normalize extension
Callers now pass the full platform dict and rom.fs_extension; the service
normalizes the extension (optional leading dot, case-insensitive) before
checking the compressed-archive skip set, so ROMs stored with bare
extensions like "zip" correctly hit the skip path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 18:05:44 -04:00
Georges-Antoine Assi
8f1b8f41d7 perf: skip RAHasher subprocess for archived disc-platform ROMs
RAHasher was being spawned for every hashable ROM regardless of file
type. When the source file is a zip/7z/tar and the RA platform needs
an on-disk disc image (PSX, PS2, PSP, Saturn, Dreamcast, Sega CD,
3DO, PC-FX, Neo Geo CD, TurboGrafx CD, Atari Jaguar CD, Wii), the
subprocess fails with "Unsupported console for buffer hash: {id}"
after paying full process-spawn overhead per ROM — a serious slowdown
when indexing large zipped collections (e.g. myrient PS2/PSP sets).

calculate_hash now short-circuits those combinations with a debug log
and no subprocess. Raw disc images (.iso, .chd, .cue/.bin) and
archives on cartridge platforms still go through RAHasher as before.

Also centralize COMPRESSED_FILE_EXTENSIONS in utils/filesystem.py so
roms_handler (is_compressed_file / hashing), rahasher (skip logic),
and feeds (PKGi passthrough) share one source of truth. The shared
set adds .rar, which is_compressed_file now recognizes too.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 17:18:14 -04:00
Georges-Antoine Assi
dbb455ece7 Merge pull request #3248 from rommapp/copilot/fix-collapsible-menu-overflow
Fix settings drawer logout button overflowing on mobile
2026-04-12 16:29:48 -04:00
Georges-Antoine Assi
85f01f70cc Merge pull request #3252 from rommapp/libretro-handler
feat: add libretro thumbnails as an artwork source
2026-04-12 16:26:11 -04:00
Georges-Antoine Assi
3ce0873931 fix 2026-04-12 16:09:36 -04:00
Georges-Antoine Assi
1b5943bd93 feat: fetch libretro Named_Snaps/Titles/Logos gated by SCAN_MEDIA
get_rom now also fetches Named_Snaps, Named_Titles, and Named_Logos
when the matching MetadataMediaType (SCREENSHOT, TITLE_SCREEN, LOGO)
is in SCAN_MEDIA. Box art is still fetched unconditionally — it drives
url_cover and libretro_id. Matching extras are appended to
url_screenshots so the scan_handler artwork priority loop picks them
up without further changes. All enabled listings are fetched
concurrently.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 16:01:37 -04:00
Georges-Antoine Assi
62e540d60e changes from bot review 2026-04-12 15:43:14 -04:00
Georges-Antoine Assi
f94c1491e5 fix: respect SCAN_ARTWORK_PRIORITY for SGDB and align libretro search with SGDB pattern
SGDB's url_cover used to clobber whatever the artwork priority loop
picked, which meant user-set priorities (e.g. libretro > sgdb) and
manually uploaded covers were silently overridden. SGDB now only
replaces the current url_cover when it outranks every other source
that produced one under SCAN_ARTWORK_PRIORITY, and never over a
manual cover preserved on UPDATE/UNMATCHED scans. Default artwork
priority gains sgdb at the top so existing "SGDB wins" behavior is
preserved for default configs.

On the /search/roms endpoint, libretro is now an enrichment source
alongside SGDB instead of a primary match source: it decorates
entries resolved by IGDB/Moby/SS/Flashpoint/Launchbox with
libretro_id and libretro_url_cover, mirroring how SGDB works.
get_matched_roms_by_name is removed from the libretro handler since
nothing else calls it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 11:52:44 -04:00
Georges-Antoine Assi
4928041593 manual cleanu 2026-04-12 11:04:12 -04:00
Georges-Antoine Assi
b3c79ab6ff fix migration order 2026-04-12 10:15:53 -04:00
Georges-Antoine Assi
6df31e2cc0 Merge branch 'master' into libretro-handler 2026-04-12 10:14:26 -04:00
Georges-Antoine Assi
59b5eefad9 Merge pull request #3249 from rommapp/10k-games-scan
fix: scan stalls on platforms with 10k+ already-scanned ROMs
2026-04-12 10:13:21 -04:00
Georges-Antoine Assi
f9f3dfd927 changes from bot review 2026-04-12 09:50:54 -04:00
Georges-Antoine Assi
abc69c790f fix scanning 2026-04-12 09:35:34 -04:00
Georges-Antoine Assi
85f9444b57 fix: restore get_roms_by_fs_name after stripped @with_details
Commit 3991e1b6e removed `@with_details` from `get_roms_by_fs_name` but
left the body using the `query` parameter that decorator was supposed
to inject, so every scan hit `'NoneType' object has no attribute
'filter'` and crashed the platform identification task.

Make the function self-contained: build `select(Rom)` directly and
eager-load only `Rom.platform`, the one relationship the scan loop
actually needs (via `rom.platform_slug` / `rom.platform.fs_slug`).
Keeps the prior commit's intent of avoiding the heavy `with_details`
eager-load on every batch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 09:10:27 -04:00
Georges-Antoine Assi
de9efb3da8 refactor: simplify mark_missing_roms with a single flips dict
Collapse the two parallel id lists and their mirrored chunked-update
loops into a `flips: dict[bool, list[int]]` keyed by desired state, and
drop unused rom assignments in the related tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 23:13:33 -04:00
Georges-Antoine Assi
522df9d31a feat: add libretro thumbnails as an artwork source
Adds the libretro thumbnail repository as a first-class artwork source so
region-correct box art (PAL/Europe, Japan, etc.) can be matched directly
to ROM filenames, addressing rommapp/romm#3239.

Implementation follows the SGDB handler pattern (artwork-only, no game
metadata): MetadataSource enum entry, scan-time fetch wired into the
SCAN_ARTWORK_PRIORITY loop, /search/roms integration, MatchRom dialog
chip + cover selection, and a heartbeat flag.

Matching is exact case-insensitive against the directory listing first
(so a ROM named "(Europe)" lands on the (Europe) artwork), with a
JaroWinkler fuzzy fallback at 0.8 that strips parenthetical tags from
both sides. Listings are cached in Redis with a 24h TTL.

`libretro_id` is persisted on the Rom model as the SHA1 hex of the
matched libretro filename — stable across scans, distinct per region,
indexed for lookup. Migration 0077 adds the column.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 22:57:20 -04:00
copilot-swe-agent[bot]
cb6b23b21a Fix logout button overflow on mobile by conditionally applying unset-height only on desktop
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/3ff1983b-80c8-48cf-9c1f-3339b60712ff

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-04-11 23:24:26 +00:00
Georges-Antoine Assi
3991e1b6ed fix: scan stalls on platforms with 10k+ already-scanned ROMs
The scan was spending excessive time on large platforms even when all ROMs
were already scanned. Root causes: per-ROM UPDATE queries for skipped ROMs
(10k individual writes), missing composite index on (platform_id, fs_name)
causing full table scans, NOT IN clauses with 10k+ values in
mark_missing_roms(), and redundant filesystem reads.

Changes:
- Add bulk_mark_present() for batch-updating skipped ROMs in one query
- Move skip detection from _identify_rom to the batch loop so skipped ROMs
  never enter the async scan pipeline, and report progress for them
- Add composite index idx_roms_platform_id_fs_name via migration 0077
- Rewrite mark_missing_roms() with flip-based approach: mark all missing,
  then un-mark present ones in chunks of 1000
- Cache filesystem reads in scan_platforms() to avoid double directory
  traversal (precounting + scanning)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 19:20:40 -04:00
copilot-swe-agent[bot]
c45e740a34 Initial plan 2026-04-11 23:16:47 +00:00
Georges-Antoine Assi
686c609b3a Merge pull request #3155 from tmgast/feature/play-session-ingest
Add play session ingest for game time tracking
2026-04-11 11:23:02 -04:00
Georges-Antoine Assi
e44adce20b Merge pull request #3246 from rommapp/fix-downgrade-migrations
fix: resolve MariaDB errors in migration downgrades (0068, 0072)
2026-04-11 11:21:19 -04:00
Georges-Antoine Assi
1eba6da6af fix: gate MariaDB-specific FK lookup behind dialect check in 0068 downgrade
The information_schema query using DATABASE() only works on MariaDB/MySQL.
Move it inside the is_postgresql guard so PostgreSQL downgrades don't error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 11:09:33 -04:00
Georges-Antoine Assi
9646d4c239 fix: resolve MariaDB errors in migration downgrades (0068, 0072)
- 0072: remove redundant index drops before drop_table in downgrade
- 0068: temporarily drop FK constraint before dropping composite index
  that MariaDB uses to back the FK on saves.rom_id
- 0068: remove redundant index drops for tables being dropped
- 0068: guard DROP TYPE behind is_postgresql check (MariaDB has no types)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 10:45:33 -04:00
Georges-Antoine Assi
2b2ed4f0ae Merge pull request #3243 from rommapp/copilot/fix-loglevel-variable-behaviour
fix: respect LOGLEVEL env var across all log output sources
2026-04-11 10:14:21 -04:00
Georges-Antoine Assi
485b6af0dd fix: wire LOGLEVEL into gunicorn logger level and RQ worker/scheduler
The gunicorn logging config hard-coded level=INFO, ignoring LOGLEVEL.
Patch it at startup via sed. Also pass --logging_level to rq worker
and rqscheduler so their framework logging respects LOGLEVEL.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 10:09:03 -04:00
Georges-Antoine Assi
af2d1f3471 changes from bot review 2026-04-11 09:58:32 -04:00
Zurdi
2a168ed697 Merge pull request #3245 from jondycz/patch-1
Fix RuffleRS scaling and overflow issues on large and small screens
2026-04-11 14:39:44 +02:00
Martin Joneš
33f785314a Add forceScale and forceAlign config properties to Ruffle player 2026-04-11 09:12:12 +02:00
Martin Joneš
12f1f450c9 Add letterbox configuration to ruffle fixing canvas overflow 2026-04-11 08:32:33 +02:00
copilot-swe-agent[bot]
bc9961cfe5 fix: remove dynamic gunicorn logging config generator from init script
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/bdfc3221-ba18-445d-9cf7-f4b495e82577

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-04-11 02:48:15 +00:00
Georges-Antoine Assi
3f9d71f741 run fmt 2026-04-10 22:45:14 -04:00
copilot-swe-agent[bot]
6e2f502b67 fix: use dynamic log level in gunicorn format and add auto-generated comment
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/0b5ef21c-89e1-4f08-b402-03f3276aab08

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-04-11 02:15:01 +00:00
copilot-swe-agent[bot]
d6036cb5ef fix: respect LOGLEVEL env var for all log output sources
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/0b5ef21c-89e1-4f08-b402-03f3276aab08

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-04-11 02:13:20 +00:00
copilot-swe-agent[bot]
cc2dffc6cc Initial plan 2026-04-11 02:03:40 +00:00
Georges-Antoine Assi
21f6bf0fd1 Merge pull request #3240 from rommapp/dependabot/npm_and_yarn/frontend/axios-1.15.0
chore(deps): bump axios from 1.13.6 to 1.15.0 in /frontend
2026-04-10 15:20:42 -04:00
Georges-Antoine Assi
44e091e1f1 Merge pull request #3238 from rommapp/safer-migrations
Safer migrations
2026-04-10 15:20:24 -04:00
dependabot[bot]
77c7110fca chore(deps): bump axios from 1.13.6 to 1.15.0 in /frontend
Bumps [axios](https://github.com/axios/axios) from 1.13.6 to 1.15.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.13.6...v1.15.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.15.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-10 05:57:18 +00:00
Georges-Antoine Assi
b0a88ff54a fix typo 2026-04-09 23:13:50 -04:00
Georges-Antoine Assi
00a10f32f2 fix 2026-04-09 23:06:25 -04:00
Georges-Antoine Assi
9a574e076a Add if_not_exists/if_exists guards to all alembic create_index/drop_index ops
Prevents errors when migrations are re-run against a database that
already has (or has already dropped) the target indexes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 23:04:08 -04:00
Georges-Antoine Assi
ccf5f656b7 Add if_not_exists/if_exists guards to all alembic add_column/drop_column ops 2026-04-09 22:50:07 -04:00
Georges-Antoine Assi
6317740466 Add if_not_exists/if_exists guards to all alembic table create/drop ops
Prevents errors when migrations are re-run against a database that
already has (or has already dropped) the target tables.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 21:46:41 -04:00
Georges-Antoine Assi
2d87625ed6 Merge pull request #3236 from rommapp/romm-3235
[ROMM-3235] Improve light mode text
2026-04-08 11:19:43 -04:00
Georges-Antoine Assi
1b23a3ebb3 changes from bot review 2026-04-08 11:17:17 -04:00
Georges-Antoine Assi
702c062499 [ROMM-3235] Improve light mode text 2026-04-08 09:22:40 -04:00
Georges-Antoine Assi
c7eaa292be add DC and PSX to DS_3DS_PLATFORMS for jewel-case aspect ratios 2026-04-08 08:33:23 -04:00