Georges-Antoine Assi 2d140e606a fix(scan): consult sources from one rule table and keep stored matches on refresh (#5394)
* refactor(scan): decide which sources a scan consults from one rule table

Each of scan_rom's 16 provider fetchers opened with its own copy of the
same gate: is the source enabled, does it cover the platform, and does
this scan type (new, complete, update, unmatched, hashes) ask it about
this rom. The copies differed in small ways (which platform field,
whether a hash scan counts, whether an id alone counts as matched) that
were only visible by reading all 16 side by side.

RESCAN_RULES now holds one RescanRule per source, and should_consult
applies them. Each fetcher's gate is a single consults() call. The
fetchers' lookup logic is unchanged.

A brute-force comparison of the old inline gates against should_consult,
over 57,600 combinations of scan type, new rom, enabled source, id,
metadata, platform id and platform slug, found no differences. The new
test_scan_rescan_rules.py pins the rules per source without a database.

The nested fetchers drop from a combined cyclomatic complexity of 215 to
87 (437 to 264 lines).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(scan): pin rescan rule columns independently, cover Hasheous' platform id

Addresses Greptile's review: an explicit table of each rule's id and
metadata columns, Hasheous in the platform-id test, and a one-sentence
should_consult docstring.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(scan): keep stored matches on refresh and pick rescans from the rule table

- Every fetcher refetches a stored id through stored_match_id(): an update,
  or an unmatched retry of missing metadata, keeps the id instead of trading
  it for a hash or filename match. IGDB now prefers it over Hasheous and
  Playmatch, MobyGames and ScreenScraper refetch it on an unmatched retry, and
  Demozoo refetches it at all.
- Playmatch runs only when a source that reads its ids will be consulted.
- should_scan_rom picks update and unmatched roms with should_consult, so the
  platform gates and the metadata check apply, and Playmatch alone picks nothing.
- unmatched_supported takes the platform instead of reading rom.platform.
- scan_rom's handler table and update_rom's refetch table take their columns
  from RESCAN_RULES; a test checks METADATA_SOURCE_COLUMNS agrees with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 15:03:01 -04:00
2026-04-15 19:20:17 -04:00
2024-05-21 19:22:14 -04:00
2024-02-11 16:41:36 +01:00
2024-07-09 13:43:14 +02:00

romm logo

A beautiful, powerful, self-hosted ROM manager and player.

Trendshift hackernews badge
selfh.st badge Discord

Overview

Scan, enrich, browse and play your ROM collection from one beautiful & free self-hosted app. Metadata from 10+ providers, save sync across your devices, and support for over 400 platforms. RomM is a must-have for anyone who plays on emulators.

Browsing a library and playing a game in RomM

Features

Installation

The easiest way to start is with the Quick Start Guide in the docs. If you're having trouble with setup, please review the page for troubleshooting steps.

Prefer a hosted deploy over wiring up the stack yourself?

Deploy on Hostinger
Starting at $6.49/mo · Setup guide
Deploy on CoreHost
Starting at $2.30/mo · Setup guide

Deployment and infrastructure support for these installs is handled by Hostinger and CoreHost. Prices are indicative and may not reflect current offerings. Both send a share of the revenue back to us, which helps fund the project.

Official apps

Playnite libraryPlaynite logo Playnite plugin

Effortlessly integrate your retro game collection into Playnite, the open-source game library manager that provides a unified interface for all of your games on PC.

Windows Desktop QR pairing

Install  by @gantoine


Argosy libraryArgosy logo Argosy

Sync your library, download games on demand and track your achievements, from a gamepad-first interface designed for Anbernic, Retroid Pocket, Odin, and similar devices.

Android Handhelds QR pairing Save sync

Download  by @tmgast


Grout multi-selectGrout logo Grout

A lightweight client for your favorite handheld custom firmwares*. Download games, box art and BIOS files wirelessly, and sync your saves automatically as you play.

Linux Handhelds Save sync

Quick start  by @BrandonKowalski

*Supports Allium, Batocera, Knulli, MinUI, muOS, NextUI, Onion, ROCKNIX, Spruce and TrimUI.

Community

Here are some cool projects maintained by members of our community. Please note that our team does not regularly review their source code.

Mobile and TV

Desktop

Handhelds and Steam Deck

Sync

Integrations

Support the project

Consider supporting this project on Open Collective. Funds cover hosting, development, and maintenance, and we pass some along to community projects to nurture a healthy ecosystem of apps.

Open Collective

Corporate Sponsors

These companies support us by providing their tools for free:

Greptile Socket

Our Friends

Here are a few projects that we think you might like:

  • Lutris: Open gaming platform for Linux
  • Cocoon: Controller-first Android frontend for retro handhelds
  • muOS: Custom firmware for Anbernic and other handhelds
  • RetroDECK: Retro gaming on SteamOS and Linux
  • Steam ROM Manager: An app for managing ROMs in Steam
  • Hasheous: Hash lookup service that maps ROMs to game metadata
  • Gaseous: Another ROM manager with web-based emulator
  • Playmatch: Microservice for matching ROM hashes to games
  • EmulatorJS: An embeddable, browser-based emulator
  • PortMaster: Native game ports for Linux handhelds
  • MelonLoader: Universal mod loader for Unity games
  • NextUI: MinUI-based custom firmware for TrimUI handhelds
  • RetroAchievements: Achievements for retro games
Description
No description provided
Readme AGPL-3.0 490 MiB
Languages
Python 50.1%
Vue 40.3%
TypeScript 7.2%
CSS 0.9%
Shell 0.6%
Other 0.8%