28 Commits

Author SHA1 Message Date
Georges-Antoine Assi
b18edb1528
fix trunk issues 2026-04-16 11:15:58 -04:00
copilot-swe-agent[bot]
bf246f842f
fix: add cus region to default ScreenScraper fallback regions
Games where only custom (cus) region artwork exists were not fetched
unless users explicitly added 'cus' to their region priority config.
Adding 'cus' to the default fallback list ensures custom artwork is
always considered as a fallback when no other regional artwork exists.

Agent-Logs-Url: https://github.com/rommapp/romm/sessions/75c3e455-f7dd-4bd6-bec7-0460987e40a0

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-04-16 14:28:51 +00: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
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
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
aa4abe6b7c
end me 2026-03-07 23:43:58 -05:00
Georges-Antoine Assi
2feb43571b
my brain is bumb 2026-03-07 23:32:04 -05:00
Georges-Antoine Assi
606799e19c
my own cleanup 2026-03-07 21:34:45 -05:00
Georges-Antoine Assi
61aface9ae
cleanup 2026-03-07 19:04:14 -05:00
Georges-Antoine Assi
92ef2cf676
some fixes 2026-03-07 18:37:29 -05:00
Georges-Antoine Assi
5f2c1a6b3b
fix tests 2026-03-07 18:24:31 -05:00
Georges-Antoine Assi
b21aa662b5
add test file 2026-03-07 16:24:22 -05:00
Georges-Antoine Assi
653d7851cb
fix tests 2025-10-21 14:39:45 -04:00
Georges-Antoine Assi
5df6c914e8
fix tests 2025-10-05 11:15:38 -04:00
Georges-Antoine Assi
debc6c4cab
run formatter 2025-09-11 22:35:19 -04:00
Georges-Antoine Assi
3c4113f8a8
Merge branch 'master' into flashpoint-metadata-handler 2025-09-11 21:27:48 -04:00
Michael Manganiello
e4e3928d1b
misc: Apply import sorting 2025-09-04 11:17:00 -03:00
Michael Manganiello
d216bad78b
misc: Add MetadataHandler's is_enabled method
Convert `MetadataHandler` to an abstract base class and add an
`is_enabled` class method that allows every metadata handler to
independently report whether it is enabled based on its configuration.

This avoids the need for global variables in the config module, allowing
us to change the enabled state of a metadata handler at runtime if
needed.
2025-09-03 22:13:28 -03:00
Georges-Antoine Assi
382c4e4a25
remove test fle 2025-08-27 16:42:49 -04:00
Georges-Antoine Assi
410c65c544
add flashpoint metadata to roms_metadata 2025-08-27 16:30:03 -04:00
Georges-Antoine Assi
ef2546ec08
fix base handler filename 2025-08-27 12:40:16 -04:00
Georges-Antoine Assi
27928bd75b
fix pytests 2025-08-27 11:41:24 -04:00
Georges-Antoine Assi
ee0110699d
fix id column type 2025-08-27 11:23:27 -04:00
Georges-Antoine Assi
bf0d864d84
Add flashpoint as a metadata handler 2025-08-27 11:04:13 -04:00
Michael Manganiello
80291f4be1
misc: Move cache initialization to startup script
Guarantee that cache is initialized during startup, and only once,
instead of every time a `MetadataHandler` object is instantiated.

Also, improve logic to determine `fixtures` paths.
2025-08-13 12:26:15 -03: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