Commit Graph

56 Commits

Author SHA1 Message Date
Georges-Antoine Assi
11f570fede fix(backend): clear a stale Hasheous match when a rehash no longer matches
A rehashed ROM whose new hashes no longer match Hasheous kept its old
`hasheous_id` and `hasheous_metadata`: the merge loop only writes truthy
values, so an empty match cannot overwrite the values seeded from the
existing ROM, and the verification flags stayed on a ROM that no longer
earned them.

Clearing on any empty match would be wrong, though: `lookup_rom` returns the
same empty fallback whether Hasheous answered "unknown hashes" or was simply
unreachable (#2236), so an outage would silently de-verify a whole library.
Have `lookup_rom` return whether it reached a definitive answer, mirroring
`meta_ss_handler.lookup_rom`, and only clear the match on a conclusive miss.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 19:13:57 -04:00
TowyTowy
27a013b1fd fix(scan): make Hasheous and SteamGridDB scan lookups fault-tolerant
HasheousHandler.lookup_rom and SGDBBaseHandler.get_details_by_names now
resolve to an empty match instead of raising, matching the best-effort
pattern already used by PlaymatchHandler.lookup_rom and
SGDBBaseHandler.get_rom_by_id, so one failing provider can't abort a
scan or discard the other providers' results (#2236).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 10:53:00 +02:00
Georges-Antoine Assi
99e8f08513 Use mD5/shA1 keys in Hasheous lookup payload
Match the json-patch camelCase key names the Hasheous endpoint expects,
and update the lookup_rom test assertions accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 09:36:31 -04:00
Georges-Antoine Assi
08e8821b4b Fix mypy types in Hasheous _request and lookup_rom
Annotate request_kwargs as dict[str, Any] to accept the list json payload,
and file_hashes as dict[str, str | None] so the chd_sha1_hash branch and the
md5/sha1/crc branch unify cleanly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 07:54:33 -04:00
Georges-Antoine Assi
650ab6925c Send all top-level file hashes to Hasheous lookup
The Hasheous ByHash endpoint now accepts an array of hash objects rather
than a single one. Send the hashes of every top-level file (using
chd_sha1_hash exclusively for files that have one) to improve lookup
accuracy, instead of picking only the largest file.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 07:43:44 -04:00
Spinnich
01f0b1d2b5 feat(hashing): compute raw CHD hashes and route disc-data SHA1 to Hasheous
CHD files now follow the same hash logic as all other file types — CRC32,
MD5, and SHA1 are computed from raw container bytes. This allows
ScreenScraper to log KO entries for unrecognised CHD files, which it
could not do when only the disc-data SHA1 was being computed.

The CHD header SHA1 (disc-data SHA1) is separately extracted and stored
in a new chd_sha1_hash field on RomFile, with a migration adding the
column to rom_files. Hasheous receives only this disc-data SHA1 (no
CRC/MD5) since it indexes disc-based games by disc-data SHA1, not raw
file hashes.

The RAHasher multi-file path now passes the largest CHD directly instead
of a /* wildcard, which RAHasher cannot expand. Hash computations are
wrapped in asyncio.to_thread to avoid blocking the event loop during
large reads.

Hash-lookup metadata handlers (ScreenScraper, Hasheous, Playmatch) now
fall back to rom.files (stored DB hashes) when fs_rom files are not
rehashed, fixing hash-based matching for UNMATCHED and UPDATE scan types.

The Disc SHA-1 is displayed in the ROM detail view for both single-file
(FileInfo.vue) and multi-file (FileSelectItem.vue) CHD games.
2026-05-17 08:01:05 -04:00
Georges-Antoine Assi
b3339c177b Run formatter on alembic files 2026-02-17 15:12:33 -05:00
Jose Diaz-Gonzalez
7fd7b74b7e Update backend/handler/metadata/hasheous_handler.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-01-03 20:16:58 -05:00
Jose Diaz-Gonzalez
6dea9f45b2 feat: allow chd lookups in the hasheous database
Redump CHDs have metadata in the hasheous database.
2026-01-03 19:59:25 -05:00
Georges-Antoine Assi
9a0b37dcfa add puredos to hasheous matches 2025-11-01 10:48:46 -04:00
Georges-Antoine Assi
a3cdef3faa changes from bot review 2025-10-31 11:58:56 -04:00
Georges-Antoine Assi
f8b0ae63a1 fix scanning multi file games with ssfr 2025-10-31 10:50:51 -04:00
Georges-Antoine Assi
0424e4450f implement hash lookup for ssfr 2025-10-30 16:00:47 -04:00
Georges-Antoine Assi
df68dc9bd9 Merge both odyssey 2 platform 2025-10-03 16:28:02 -04:00
Georges-Antoine Assi
2481bac019 refine states 2025-09-20 19:48:52 -04:00
Georges-Antoine Assi
7a5185fe22 complete rest of handler 2025-09-20 19:38:26 -04:00
Georges-Antoine Assi
8c33a95637 remove hartbeat from bh endpoint 2025-09-20 17:57:38 -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
ef2546ec08 fix base handler filename 2025-08-27 12:40:16 -04:00
Georges-Antoine Assi
84ded3bc24 pick largest file from the list 2025-08-09 14:47:34 -04:00
Georges-Antoine Assi
1955da78f2 finish all the handlers 2025-07-24 17:05:39 -04:00
Georges-Antoine Assi
8a76528815 finish translating keys 2025-07-24 16:09:49 -04:00
Georges-Antoine Assi
b431aa4d7e manual fixes 2025-07-24 15:43:03 -04:00
Georges-Antoine Assi
39e6fd3579 use ups keys for all lists 2025-07-24 15:30:03 -04:00
Georges-Antoine Assi
973f42cd0b update watasra supervision 2025-07-23 22:20:18 -04:00
Georges-Antoine Assi
595c52bcab Unify singular slugs 2025-07-23 21:52:52 -04:00
Georges-Antoine Assi
6056169095 ony use cue files for dreamcast 2025-07-15 10:31:00 -04:00
Georges-Antoine Assi
546c797409 limit file extensions hasheous for some platforms 2025-07-15 10:16:39 -04:00
Georges-Antoine Assi
5d6ae2c842 stop overwriting IDs on scan 2025-07-14 10:31:19 -04:00
Georges-Antoine Assi
9852f1e9aa send first file to hasheous for hash calc 2025-07-13 12:03:25 -04:00
Georges-Antoine Assi
2f5a31b82f use info instead of warn 2025-07-12 11:30:58 -04:00
Georges-Antoine Assi
c76caed145 normalized search results 2025-07-12 09:56:18 -04:00
Georges-Antoine Assi
c1098fc16b Misc metadata fixes 2025-07-11 18:17:14 -04:00
Georges-Antoine Assi
7906dc0d6b use correct beta api key 2025-07-11 09:50:24 -04:00
Georges-Antoine Assi
bd06961fa5 fix hasheous url_screenshots again 2025-07-10 16:10:23 -04:00
Georges-Antoine Assi
cbdb166b83 store are req props on ron if scan fails 2025-07-10 13:14:40 -04:00
Georges-Antoine Assi
ca5f8eacb1 add more moby slugs 2025-07-09 15:08:45 -04:00
Georges-Antoine Assi
837d36375d Fix metadata issues in heasheous handler 2025-07-09 09:14:41 -04:00
Georges-Antoine Assi
aea315ff24 complete hasheous proxy 2025-07-05 18:29:13 -04:00
Georges-Antoine Assi
691697b6fd fix first release date 2025-07-05 18:21:08 -04:00
Georges-Antoine Assi
6f41c07c97 use right api endpoint 2025-07-05 13:31:59 -04:00
Georges-Antoine Assi
10eb50b501 Merge branch 'master' into hasheous-igdb-proxy 2025-07-05 09:59:01 -04:00
Georges-Antoine Assi
4158b278eb fix check issues 2025-07-04 17:55:45 -04:00
Georges-Antoine Assi
e23c86358c IGDB ID should be an int for hasheous 2025-07-01 15:33:28 -04:00
Georges-Antoine Assi
f9ff5a6c8a add placeholder for ra metadat proxy 2025-06-18 11:33:07 -04:00
Georges-Antoine Assi
41d7bf8f13 start using hasheous as igdb proxy 2025-06-18 10:08:20 -04:00
Georges-Antoine Assi
66741474cf catch 404 errors in hasheous 2025-06-17 12:46:07 -04:00
Georges-Antoine Assi
66cf16d386 use hasheous as a populator to igdb and ra 2025-06-16 22:29:30 -04:00