Skip to content

Commit 99e8f08

Browse files
gantoineclaude
andcommitted
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>
1 parent 69a7a13 commit 99e8f08

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

backend/handler/metadata/hasheous_handler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,11 @@ async def lookup_rom(self, platform_slug: str, files: list[RomFile]) -> Hasheous
260260
if file.chd_sha1_hash:
261261
# CHD files are indexed by disc-data SHA1 only
262262
# Raw file MD5/CRC are hashes of the container and won't match
263-
file_hashes = {"sha1": file.chd_sha1_hash}
263+
file_hashes = {"shA1": file.chd_sha1_hash}
264264
else:
265265
file_hashes = {
266-
"md5": file.md5_hash,
267-
"sha1": file.sha1_hash,
266+
"mD5": file.md5_hash,
267+
"shA1": file.sha1_hash,
268268
"crc": file.crc_hash,
269269
}
270270

backend/tests/handler/test_fastapi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,8 @@ async def test_lookup_rom_sends_all_top_level_file_hashes(
361361
mock_request.assert_called_once()
362362
sent_data = mock_request.call_args.kwargs["data"]
363363
assert sent_data == [
364-
{"md5": "md5one", "sha1": "sha1one", "crc": "crcone"},
365-
{"sha1": "chdsha1"},
364+
{"mD5": "md5one", "shA1": "sha1one", "crc": "crcone"},
365+
{"shA1": "chdsha1"},
366366
]
367367

368368

0 commit comments

Comments
 (0)