mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 10:01:00 +01:00
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:
@@ -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:
|
||||
|
||||
@@ -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"]}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user