Commit Graph

39 Commits

Author SHA1 Message Date
Georges-Antoine Assi
36b7c228bc Address review: guard region_mode type and scope it to media
Non-string region_mode values (YAML list/mapping) now take the
warn-and-fallback path instead of raising TypeError on the frozenset
membership check during startup.

get_preferred_regions only applies prefer_config reordering when
selecting media (for_media=True); name and release-date selection keep
the rom-tags-first ordering, matching the documented scope.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 17:52:44 -04:00
Georges-Antoine Assi
67eab49a72 Add scan.priority.region_mode to prefer config regions for media
New opt-in config key scan.priority.region_mode with values
prefer_rom_tags (default, current behavior) and prefer_config. With
prefer_config, the configured region priority outranks the rom's
filename region tags when selecting ScreenScraper media, and the rom's
own tags remain the fallback when the configured regions have no media.
Unknown values warn and fall back to prefer_rom_tags, and the key
survives runtime config-file rewrites.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 16:46:38 -04:00
Georges-Antoine Assi
191cd1f24c feat(config): editable v2 UI for scan settings
Expose the scan.* section of config.yml (metadata & artwork priority,
per-field artwork overrides, region priority, language priority, media
types, gamelist and pegasus export) in an editable v2 Settings page.

Backend:
- Add PUT /api/config/scan (platforms.write) with a validated
  ScanSettingsPayload and ConfigManager.update_scan_settings().
- Expose GAMELIST_AUTO_EXPORT_ON_SCAN and PEGASUS_AUTO_EXPORT_ON_SCAN
  in ConfigResponse / GET /api/config.
- Preserve the streaming section on runtime config writes (previously
  dropped on every write).

Frontend:
- New Settings/ScanSettings.vue page + ScanPriorityList.vue reorderable
  list (drag + up/down for keyboard/gamepad); region/language use
  RComboboxField.
- Wire the scan-settings route, permissions, and sidebar entry.
- Regenerate OpenAPI types; add all new strings to every locale.

Closes #3849

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 11:24:31 -04:00
Georges-Antoine Assi
eed2785e35 feat(scan): warn on unknown sources in artwork priority overrides
Unknown provider slugs in scan.priority.cover/screenshot/manual are
already dropped by the downstream availability filter, so they never
crash a scan, but they silently did nothing. Surface likely typos with
a load-time warning, consistent with scan.media handling. A drift-guard
test keeps VALID_SCAN_PRIORITY_SOURCES in sync with MetadataSource.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 19:07:26 -04:00
Georges-Antoine Assi
096346a981 feat(scan): per-field artwork priority overrides
Add optional scan.priority.cover / screenshot / manual keys that each
override scan.priority.artwork for a single artwork field, falling back
to the shared artwork priority when omitted. This lets users, for
example, keep original box art for covers while sourcing screenshots
from a different provider.

Backward compatible: absent keys leave behavior unchanged. Config-only
(no UI), read-only exposure via GET /api/config.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 18:56:47 -04:00
Georges-Antoine Assi
8e74790d25 fix: clear stale config parse error on missing/recreated config
_config_file_parse_error was only reset inside _safe_load_yaml, so the
FileNotFoundError paths (get_config and _create_missing_config_file) that
bypass it kept a stale error. Deleting a malformed config could then still
report a YAML error for the new empty config. Reset the flag in both paths.

Generated-By: PostHog Code
Task-Id: 3d4f28a8-5157-4ca4-97a6-f283f5d6329e
2026-07-09 19:58:42 -04:00
Georges-Antoine Assi
28aa53107b fix: surface config.yml parse errors instead of silently using defaults
A YAML syntax error in config.yml caused _safe_load_yaml to discard the
entire config and boot on defaults, with only a log line as signal. Users
mixing the old (scan.export) and new (scan.gamelist.export) gamelist syntax
produced invalid YAML that was silently ignored, so their scan.media list was
dropped and only the default media (box2d, screenshot, manual) were scanned.

Track the parse error and expose it via CONFIG_FILE_PARSE_ERROR on the config
API, and show an error banner in the Library Management settings (v1 and v2)
so users know their config failed to parse and RomM is running on defaults.

Fixes #3708

Generated-By: PostHog Code
Task-Id: 3d4f28a8-5157-4ca4-97a6-f283f5d6329e
2026-07-09 19:37:55 -04:00
Georges-Antoine Assi
2246ea3879 fix tests 2026-06-13 15:39:55 -04:00
Georges-Antoine Assi
45416c99f1 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-13 13:45:11 -04:00
copilot-swe-agent[bot]
fd61895e07 Fix config.yml gamelist media serialization
Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-06-13 11:14:20 +00:00
Georges-Antoine Assi
90945685e4 Stuff 2026-05-17 12:43:33 -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
copilot-swe-agent[bot]
9ef217339f test(config): cover auto-created config directory
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/0c94e1c8-0f79-4f5f-a72b-e45832906d00

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-05-08 13:54:19 +00:00
copilot-swe-agent[bot]
fdd9047b37 feat(config): auto-create missing config.yml on startup
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/0c94e1c8-0f79-4f5f-a72b-e45832906d00

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-05-08 13:52:53 +00:00
Georges-Antoine Assi
af69630481 more self review 2026-04-05 23:17:57 -04:00
Georges-Antoine Assi
fafb804bc6 mega cleanup 2026-04-05 22:35:37 -04:00
Georges-Antoine Assi
a61ff81e22 Merge branch 'master' into gamelist-customize 2026-04-05 22:11:02 -04:00
Georges-Antoine Assi
6abf60b0fe last fixes 2026-04-03 11:49:32 -04:00
Georges-Antoine Assi
ceddf2f9e9 changes from bot review 2026-04-03 11:24:02 -04:00
Georges-Antoine Assi
ec8583016b mega ton of fixes for 4.8 2026-04-03 10:54:31 -04:00
Vargash
f4c965be33 feat: add new export.gamelist.media.image configuration
also fix broken title_screen/miximage/physical key name usage
2026-03-31 11:16:40 +02:00
Vargash
3e072873e1 feat: new export.gamelist.media.thumbnail configuration 2026-03-31 11:00:49 +02:00
Georges-Antoine Assi
acfc189798 [ROMM-2927] Add default folders to config manager 2026-02-09 14:55:29 -05:00
Georges-Antoine Assi
11cfc7ea43 Add config options to disable batch bootup and auto unload in emujs 2025-12-21 10:50:27 -05:00
Georges-Antoine Assi
27c83e4736 add config entry to enable netplay 2025-12-08 22:58:48 -05:00
Georges-Antoine Assi
099d58b1e5 add config for netplay 2025-11-26 15:19:45 -05:00
zurdi
c7b5eea91e Add skip_hash_calculation configuration and update related tests 2025-11-20 17:29:37 +00:00
Georges-Antoine Assi
adbac5aa6e fix test 2025-10-28 13:43:10 -04:00
Georges-Antoine Assi
0f0676a486 fix emujs config vsync typo 2025-10-28 13:37:15 -04:00
Georges-Antoine Assi
f30f0bfd75 Smarter detection of whether to scan roms 2025-10-26 13:21:56 -04:00
Georges-Antoine Assi
463bb27ea9 Add config to store media on disk 2025-10-24 16:04:54 -04:00
Georges-Antoine Assi
b3a1b6a361 add to example config 2025-09-21 19:23:20 -04:00
Georges-Antoine Assi
ba2dcbff1b changes from review 2025-09-06 19:17:24 -04:00
Georges-Antoine Assi
06768abb06 [ROMM-2336] Config entry for EJS_CacheLimit 2025-09-06 19:10:44 -04:00
Georges-Antoine Assi
bb004fce6c fix tests 2025-09-02 09:40:43 -04:00
Georges-Antoine Assi
d760a2923e change options to settings 2025-09-02 09:10:32 -04:00
Georges-Antoine Assi
e42acbfafc add debug and controls 2025-09-02 08:38:11 -04:00
Georges-Antoine Assi
147a94c406 Load core options from config.yml 2025-09-01 21:16:37 -04:00
Michael Manganiello
ba21cbc1e1 misc: Separate tests folder from backend code
Create separate `tests/` folder for all tests. This will also simplify
not copying tests code into the Docker image.
2025-08-08 12:49:13 -03:00