docs: tighten the launchbox key-normalization comments

Both blocks ended on a counterfactual about what storing raw text would
do, which explains the change rather than the behaviour. State what the
code does instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Sam Dornan
2026-08-05 19:19:55 -05:00
parent 3fb2e36350
commit 26505ccca4
2 changed files with 5 additions and 9 deletions

View File

@@ -143,10 +143,8 @@ class UpdateLaunchboxMetadataTask(RemoteFilePullTask):
# Update initial progress
update_stats.update(processed=processed_files, total=total_files)
# Every key below is stored the way lookups build it (stripped,
# and lowercased wherever the lookup lowercases). Storing the
# raw XML text instead would bury an entry behind whitespace
# nothing ever queries for.
# Keys are stored the way lookups build them: stripped, and
# lowercased wherever the lookup lowercases.
for file in file_list:
if file == "Platforms.xml":
with z.open(file, "r") as f:

View File

@@ -186,11 +186,9 @@ class TestUpdateLaunchboxMetadataTask:
files_calls = [call for call in hset_calls if call[0][0] == LAUNCHBOX_FILES_KEY]
assert len(files_calls) == 2
# The fixture pads one entry per index the way a pretty-printed dump
# would. Keys have to come out normalized, or nothing would ever query
# them: lookups strip (and lowercase, where the index is lowercased).
# The Files key carries its platform too, since the same dump filename
# exists on several systems.
# The fixture pads one entry per index, as a pretty-printed dump does.
# Keys come out normalized, and the Files key carries its platform,
# since one dump filename exists on several systems.
def fields(calls) -> set[str]:
return {field for call in calls for field in call[1]["mapping"]}