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>
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>
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>
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>
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>
_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
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
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>