Fix incorrect game names detected by MinetestCheck

This commit is contained in:
rubenwardy 2020-08-18 00:25:13 +01:00
parent 3914659718
commit 85551539f0

@ -72,7 +72,7 @@ class PackageTreeNode:
# .conf file
try:
with open(self.getMetaFilePath(), "r") as myfile:
with open(self.getMetaFilePath() or "", "r") as myfile:
conf = parse_conf(myfile.read())
for key, value in conf.items():
result[key] = value
@ -116,6 +116,11 @@ class PackageTreeNode:
if "optional_depends" in result:
result["optional_depends"] = [x.strip() for x in result["optional_depends"].split(",")]
# Fix games using "name" as "title"
if self.type == ContentType.GAME:
result["title"] = result["name"]
del result["name"]
# Calculate Title
if "name" in result and not "title" in result:
result["title"] = result["name"].replace("_", " ").title()