127 Commits

Author SHA1 Message Date
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
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
eda88b70d1 get claude to refactor launchbox_handler 2026-03-07 16:02:39 -05:00
Georges-Antoine Assi
395b857592 changes from self review 2026-03-07 14:44:02 -05:00
Georges-Antoine Assi
fb0dc84af4 Merge pull request #2800 from victor-rds/feat-search-metadata-priority
feat: Manual Match metada priority
2025-12-23 11:34:24 -05:00
Georges-Antoine Assi
7cec83e621 fix trunk errors 2025-12-23 11:22:16 -05:00
Georges-Antoine Assi
d25427aac1 run trunk fmt 2025-12-23 10:56:48 -05:00
Victor R. Santos
d9604ac8db Manual Search Metadata Priority
Refactor `search_rom` to follow the same metadata source priority list configured for automatic scans.
2025-12-23 04:28:36 -03:00
Victor R. Santos
6d992c5655 Enable Launchbox search by Id (DatabaseID) 2025-12-22 17:14:07 -03:00
Georges-Antoine Assi
463bb27ea9 Add config to store media on disk 2025-10-24 16:04:54 -04:00
Georges-Antoine Assi
dbf1a7d20b [ROMM-2554] Remove htlb from manual search 2025-10-17 09:51:41 -04:00
Georges-Antoine Assi
cf50f06531 fix search endpoint excluding lb and hltb 2025-10-10 16:21:21 -04:00
Georges-Antoine Assi
6934721fa3 [ROMM-2492] Add html to search reults 2025-09-29 08:28:51 -04:00
Georges-Antoine Assi
c4bd619091 fix bugs from bot review 2025-09-18 16:38:32 -04:00
Georges-Antoine Assi
fe2a7e7bff Add launchbox to manual match window 2025-09-18 16:34:40 -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
841992e9fb fix flashpoint search 2025-08-27 12:05:02 -04:00
Georges-Antoine Assi
bf0d864d84 Add flashpoint as a metadata handler 2025-08-27 11:04:13 -04:00
Georges-Antoine Assi
c742e8ff9d dont remove articles normalize name 2025-08-15 22:48:57 -04:00
Georges-Antoine Assi
e0d1d1cf23 run sgdb in parallel 2025-08-15 22:30:13 -04:00
Georges-Antoine Assi
7c3764802f add sgdb as a cover option 2025-08-15 22:14:48 -04:00
Georges-Antoine Assi
54adb653af Normalize result names for better merging in search 2025-08-15 21:57:18 -04:00
Michael Manganiello
097818d560 misc: Replace emoji dependency with constants
The `emoji` library has been removed, in favor of using constants for
the few emojis used in the codebase. This reduces memory usage, and
avoids calling `emojize` for Python to discover where to replace emojis
in pre-defined strings.
2025-08-07 09:50:14 -03:00
Georges-Antoine Assi
c5b8a5d0a7 config file is now required 2025-07-24 23:34:13 -04:00
Georges-Antoine Assi
2a1e13b506 change from code review 2025-07-13 15:30:00 -04:00
Georges-Antoine Assi
c23249358e Always set all platform metadata IDs 2025-07-13 14:13:00 -04:00
Michael Manganiello
252722e3bc misc: Apply pyupgrade changes for Python 3.12 compatibility
Command applied:
```
find ./backend/ -type f -name "*.py" -exec pyupgrade --py312-plus {} \;
```
2025-06-29 12:27:16 -03:00
zurdi
14761c2c83 refactor: enhance logging with highlighted output for improved readability 2025-05-09 09:05:59 +00:00
zurdi
53f9386208 refactor: enhance logging messages and formatting for improved clarity and consistency 2025-05-08 23:35:33 +00:00
zurdi
2a5bf1ab5b Add SGDBInvalidAPIKeyException for handling invalid API key errors 2025-04-01 09:52:33 +00:00
zurdi
cfbcd82547 fix: changes based on review 2025-02-17 11:10:24 +00:00
zurdi
c33217bc24 Add ss_url_cover field to search response 2025-02-12 12:41:16 +00:00
zurdi
e51dfc3eec Merge remote-tracking branch 'origin/master' into feature/screenscraper-integration 2025-02-10 08:59:28 +00:00
Michael Manganiello
70825830c4 misc: Set prefix and tags to API routers
Improve OpenAPI documentation by setting tags to each API router. Also,
set a prefix to each router to group the endpoints by their
functionality.
2025-02-09 11:31:13 -03:00
zurdi
cb54ee3a23 fix: fixes from trunk 2025-02-04 12:41:49 +00:00
zurdi
9d96501b9e Merge remote-tracking branch 'origin/master' into feature/screenscraper-integration 2025-01-31 00:12:44 +00:00
Georges-Antoine Assi
9d8baef9de small tweaks from review 2025-01-15 22:54:35 -05:00
Georges-Antoine Assi
696a1c6122 Merge branch 'master' into rom-hashing-background-task 2025-01-15 21:51:23 -05:00
zurdi
a7a2e3b253 Merge remote-tracking branch 'origin/master' into feature/screenscraper-integration 2025-01-09 15:13:49 +00:00
Michael Manganiello
865370ec13 misc: Move auth constants to separate file
This simplifies avoiding circular imports when trying to use auth
handlers.
2025-01-08 22:16:31 -03:00
zurdi
23102b8aeb fix: trunk check 2025-01-06 13:32:28 +00:00
zurdi
e7342ab457 Merge remote-tracking branch 'origin/master' into feature/screenscraper-integration 2025-01-06 12:53:38 +00:00
Michael Manganiello
1c7cbc2328 misc: Change signature for get_matched_rom_by_id function
The previous function name `get_matched_roms_by_id` was misleading as it
returned a list of matched ROMs, but searching by ID should always
return either one result or none.
2025-01-05 15:18:19 -03:00
zurdi
a9f189bad4 Merge remote-tracking branch 'origin/master' into feature/screenscraper-integration 2025-01-05 16:49:37 +00:00
Michael Manganiello
81febf232f fix: Change rom_id type to int in search endpoint
Fixes PostgreSQL query error reported in:
https://github.com/rommapp/romm/issues/667#issuecomment-2571428721
2025-01-05 00:33:12 -03:00