Small fixes to prevent changes when updating
This commit is contained in:
parent
67b2984f91
commit
2cbea8c226
1330 changed files with 1562 additions and 752 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -28,9 +28,10 @@ def collect_regex_pattern(service, file_name, input_json, output_dir):
|
|||
name = spec.get("name", "")
|
||||
yml_data = {
|
||||
"name": get_file_name(name),
|
||||
"pattern": pattern,
|
||||
"pattern": get_file_name(pattern),
|
||||
"description": "",
|
||||
"tags": [],
|
||||
"tests": [],
|
||||
}
|
||||
|
||||
# Output path
|
||||
|
|
|
|||
|
|
@ -1,2 +1,8 @@
|
|||
def get_file_name(profile_name):
|
||||
return profile_name.replace("/", "-").replace("[", "(").replace("]", ")")
|
||||
return (
|
||||
profile_name.replace("/", "-")
|
||||
.replace("[", "(")
|
||||
.replace("]", ")")
|
||||
# TODO: This triggers to often, how to be more specific?
|
||||
.replace("HDR10Plus", "HDR10+")
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue