Repository navigation
Platform registry + search-context detection for retro consoles (implements #61) - #62
Merged
Merged
Conversation
Platforms were defined in about nine places - the category map, the extra platform list, metadata.json names, two extension tables, the manual import switch, the library scan's extension list and display names, orphan recovery hints, scoring size bands, Torznab routing and RAWG ids - and they had drifted apart (GBC was detectable by extension but not a platform, Atari 2600 was a source slug with no platform behind it). internal/platform/registry.go now holds one entry per platform: RomM slug, name, owned and extra search categories, unique ROM extensions, hint-only formats, size band, RAWG ids and names, metadata aliases and a title hint. Every existing table and exported function is derived from it and keeps its signature. Title hints resolve by longest match, so "Xbox 360" still beats "Xbox" without relying on list order, and extension detection now votes by file count, looks inside .zip archives, and is deterministic. Adds GBC, Master System, Game Gear, Sega CD, 32X, PC Engine/TurboGrafx-16, PC Engine CD, Neo Geo AES/MVS, Neo Geo CD, Neo Geo Pocket, Atari 2600/5200/7800, Lynx, ColecoVision, Famicom Disk System, Virtual Boy, WonderSwan, 3DO, CD-i, MSX, C64, Amiga, DOS, PC-98, Vectrex, Satellaview, Sega Pico and Game & Watch. Arcade and current-generation consoles stay out. /api/platforms lists the registry in order, so the UI follows it. Test expectations change where the old tables disagreed with each other: manual import now names n64 "Nintendo 64" like everywhere else, and Amiga and Atari 2600 now have RAWG mappings.
A platform-filtered Prowlarr search used to keep a result only when one of its categories was in the platform's category list. Retro systems have no Newznab subcategory and trackers rarely have one either, so their releases arrive as Console, Console/Other, an unmapped tracker category or nothing, and were either dropped or kept as "Unknown" - and for a platform with no categories of its own every categorised result passed, PS2 releases in a SNES search included. The filter now asks the registry (platform.SearchContext). A category the platform owns keeps the result under that platform; a category that positively names something else - another platform, PC, an unmapped console subcategory such as Xbox One, or a non-game Newznab range - drops it; and a result with only generic, unknown or no categories is kept and assigned the searched platform, which then travels with the result into the download job and decides the import folder. A PC repack name drops an otherwise generic result. PC searches, Switch's PC/Games request for Nyaa, and slugs outside the registry keep their previous behaviour.
Search context can now file a Console/Other result under the platform that was searched for, which is right for a SNES search that finds a SNES ROM and wrong when the release turns out to be a GBA ROM. Import already detected the platform from files when a job had none; it now also checks a console platform the job does carry. When none of the downloaded files is a format the job's platform uses and the unique ROM extensions among them (loose, in subfolders, or inside a .zip) all point at another platform, the job is refiled there and the row updated, with a warning in the log. Content that includes any of the platform's own formats is never second-guessed, so a Switch release with a stray .nes inside stays a Switch release, and shared disc formats (.iso, .chd, .cue, .bin) never count as evidence. A platform picked by hand with the Organize button is marked on the job and left alone.
HACKS_SUFFIX_ROUTING=true (default false) files a ROM whose release or file
name looks like a hack or fan translation under GAMES_ROMS_PATH/<slug>-hacks
instead of <slug>, so RomM can keep them apart from the clean set. A name
counts as a hack when it carries a GoodTools/RHDN [h...] tag (lowercase h,
so [HD] does not match), a [T+...]/[T-...] translation tag, (Hack), or the
word "hack" ("ROM hack" included, the .hack// series excluded).
All four ROM destinations honour it: torrent import, DDL, Usenet (including
the restart-recovery lookup) and manual import. The library scan names a
hacks folder after its platform ("SNES Hacks") and accepts that platform's
own formats inside it.
JeremiahM37
marked this pull request as ready for review
September 29, 2026 06:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the proposal in #61. Stacked on #60 (standard Newznab console categories) — the first commit here is #60; review/merge that first and this PR's diff shrinks to the four commits below. Opened as a draft so you can say whether you want it whole, split, or trimmed.
Commits
PlatformMap,ExtraPlatforms, extension maps, organize/library detection, scoring size bands, Torznab categories, RAWG mapping and/api/platformsall derive from it; existing exported signatures are unchanged.<slug>-hacks—HACKS_SUFFIX_ROUTING(default off) for[h…],[T+/-…],(Hack)releases.Adds retro platforms with RomM-compatible slugs (gbc, sms, gamegear, segacd, sega32, tg16, turbografx-cd, neogeoaes, neo-geo-cd, ngp, atari5200, atari7800, lynx, colecovision, fds, virtualboy, wonderswan-color, 3do, cdi, msx, c64, amiga, dos, pc98, vectrex, satellaview, sega-pico, g-and-w). Arcade and current-gen consoles deliberately left out.
Behaviour changes worth a look
psvita, 1060 WiiWare → Wii); README's slug table fixed (dc/ngc, no PS5).Testing
gofmt,go vetclean;go test ./...— 749 tests pass. (TestRecoverOrphanedTorrentsIsIdempotentis flaky ~3/200 on unmodified main too; unrelated.)Code drafted with AI assistance; full test suite run before submitting.