feat: Add ScreenScraper metadata proxy support via Hasheous#3674
feat: Add ScreenScraper metadata proxy support via Hasheous#3674gantoine wants to merge 4 commits into
Conversation
Generated-By: PostHog Code
Greptile SummaryThis PR adds ScreenScraper metadata lookup through the Hasheous proxy. The main changes are:
Confidence Score: 4/5The scan integration can replace preferred metadata and lets an optional proxy outage fail the combined fetch.
backend/handler/scan_handler.py Important Files Changed
Reviews (1): Last reviewed commit: "mroe cleanup" | Re-trigger Greptile |
| meta_hasheous_handler.get_ss_game( | ||
| rom, platform.ss_id, get_match_files() | ||
| ), |
There was a problem hiding this comment.
When both direct ScreenScraper and Hasheous are enabled, this lookup runs alongside the direct request instead of waiting for it to be unavailable or return no match. The proxy result can then replace metadata from the configured ScreenScraper account, so the direct source is not actually prioritized.
| **igdb_game, | ||
| } | ||
| ) | ||
| return HasheousRom({**hasheous_rom, **ra_game, **igdb_game, **ss_game}) |
There was a problem hiding this comment.
| meta_hasheous_handler.get_ss_game( | ||
| rom, platform.ss_id, get_match_files() | ||
| ), |
There was a problem hiding this comment.
A network error from this new proxy request raises an HTTP 503 through _request(), and asyncio.gather propagates it from the combined Hasheous fetch. An outage limited to the optional ScreenScraper endpoint can therefore discard successful IGDB and RA work and fail the ROM scan.
TL;DR
Adds ScreenScraper metadata fetching through the Hasheous proxy as a credential-free fallback when users don't have their own ScreenScraper account. This leverages new Hasheous endpoints for game metadata lookups by hash or game ID.
What changed?
Hasheous Handler Enhancement: Added
get_ss_game()andget_ss_rom_by_id()methods to fetch ScreenScraper metadata through the Hasheous proxy endpoint (/MetadataProxy/ScreenScraper/jeuInfos.php)get_ss_game()performs hash-based lookups (MD5, SHA1, CRC) with file size and name as fallbacksget_ss_rom_by_id()refetches metadata by existing game IDbuild_ss_game()to maintain consistent metadata structureScan Handler Integration: Updated ROM scanning logic to fall back to Hasheous ScreenScraper proxy when:
meta_ss_handlernot enabled)File Filtering: Implemented platform-specific file extension filtering for hash-based lookups, selecting the largest valid file as most likely to contain the main ROM
Test Coverage: Added comprehensive unit tests for the Hasheous ScreenScraper proxy functionality
Checklist
Created with PostHog Code