feat(metadata): add RAWG.io as a metadata source - #4080
Open
BlizzHacker wants to merge 1 commit into
Open
Conversation
RomM has twelve metadata handlers and RAWG is not among them. RAWG is a large general-purpose games database with a generous free tier, which makes it a reasonable first source for anybody who has not yet obtained IGDB or MobyGames credentials. It is offered as an additional source rather than a replacement: RAWG is strongest on modern and PC titles and thinner on the retro catalogue than IGDB, MobyGames or ScreenScraper, so it is unlikely to beat them on the platforms RomM users care most about. Follows the existing handler shape: RAWG_API_KEY gates it, is_enabled() returns False without one, a (rawg-12345) filename tag pins a match by hand, and get_matched_roms_by_name backs manual matching. Platforms are mapped only where RAWG actually has the platform. A good deal of the retro catalogue is simply absent there, and mapping those to a near neighbour would return confident matches for the wrong system -- worse than returning nothing. 44 platforms mapped; anything else yields rawg_slug=None and the handler stays out of the way. An unmapped platform returns the fallback rather than searching every platform RAWG knows, for the same reason. 401 and 404 are logged and return an empty result rather than raising, so a bad key or an unknown id lets the next handler in the chain try instead of failing the scan.
gantoine
self-requested a review
August 3, 2026 12:07
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.
RomM has twelve metadata handlers and RAWG isn't among them. This adds it.
What it's for, and what it isn't
RAWG is a large general-purpose games database with a generous free tier, which makes it a reasonable first source for anybody who hasn't yet obtained IGDB or MobyGames credentials.
Being straight about the limits, because I'd rather you judge it accurately than merge it on enthusiasm: RAWG is strongest on modern and PC titles and thinner on retro than IGDB, MobyGames or ScreenScraper. It is unlikely to beat any of them on the platforms most RomM users care about. It's offered as an additional source, not a replacement for anything, and it's disabled unless a key is set.
If you'd rather not carry a thirteenth handler for that value, closing this is a completely reasonable call and no follow-up is needed.
Shape
Follows the existing handler pattern:
RAWG_API_KEYgates it;is_enabled()returnsFalsewithout one(rawg-12345)filename tag pins a match by hand, same convention asmoby-andhltb-get_matched_roms_by_namebacks manual matching, unfiltered by similarity so the operator can choosehandler/metadata/__init__.pyasmeta_rawg_handlerTwo decisions worth flagging
Platforms are mapped only where RAWG actually has the platform. A good deal of the retro catalogue is simply absent there. Mapping those to a near neighbour returns a confident match for the wrong system, which is worse than returning nothing — so 44 platforms are mapped and anything else yields
rawg_slug=Noneand the handler stays out of the way. I removed ac64 → commodore-amigamapping from my own first draft for exactly this reason.An unmapped platform returns the fallback rather than searching unfiltered. Searching every platform RAWG knows finds something for almost any title, and that something is frequently the wrong console's release.
401 and 404 are logged and return an empty result rather than raising, so a bad key or an unknown id lets the next handler in the chain try instead of failing the scan.
What I verified, and what I couldn't
Verified: the handler imports and runs correctly inside a real RomM instance (4.9.2 container) — platform mapping, case-insensitivity, the filename tag, and metadata extraction from a sparse response all behave. Every
UniversalPlatformSlugmember referenced was checked againstbase_handler.pyprogrammatically; the first draft had three wrong names and one wrong platform mapping, all fixed.Not verified: I could not run your pytest suite — the deps aren't in my environment and the production image doesn't ship pytest. The included tests are written to match
test_igdb_handler.py's style but have not been executed. Please treat them as unrun until CI says otherwise.Also untested against a live RAWG key, so the exact response-field mapping (
description_raw,short_screenshots,released_timestamp) is from their published API docs rather than an observed payload. Happy to adjust once someone with a key runs it.Docs
I haven't touched the docs site or
.env.example— tell me where you'd likeRAWG_API_KEYdocumented and I'll add it.Offered as a gift from the Cartridge project. Thanks for RomM — your EmulatorJS core map is what our playability routing is built on, and it's credited as such.