Small fixes to prevent changes when updating

This commit is contained in:
Johan van Eck 2025-07-26 14:41:34 +03:00
parent 67b2984f91
commit 2cbea8c226
1330 changed files with 1562 additions and 752 deletions

View file

@ -33,7 +33,7 @@ def collect_custom_format(service, file_name, input_json, output_dir):
conditions = []
for spec in input_json.get("specifications", []):
condition = {
"name": spec.get("name", ""),
"name": get_file_name(spec.get("name", "")),
"negate": spec.get("negate", False),
"required": spec.get("required", False),
"type": IMPLEMENTATION_TO_TYPE_MAPPING.get(
@ -70,14 +70,15 @@ def collect_custom_format(service, file_name, input_json, output_dir):
"description": f"""[Custom format from TRaSH-Guides.](https://trash-guides.info/{service.capitalize()}/{service.capitalize()}-collection-of-custom-formats/#{file_name})
{markdownify(input_json.get('description', ''))}""".strip(),
"metadata": {
"includeInRename": input_json.get("includeCustomFormatWhenRenaming", False),
},
"tags": IMPLEMENTATION_TO_TAG_MAPPING[implementation],
"conditions": conditions,
"tests": [],
}
include_in_rename = input_json.get("includeCustomFormatWhenRenaming", False)
if include_in_rename:
yml_data["metadata"] = {"includeInRename": include_in_rename}
# Output path
output_path = os.path.join(output_dir, f"{get_file_name(name)}.yml")
with open(output_path, "w", encoding="utf-8") as f: