aboutsummaryrefslogtreecommitdiff
path: root/app/tasks/minetestcheck/tree.py
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2020-08-18 00:25:13 +0100
committerrubenwardy <rw@rubenwardy.com>2020-08-18 00:25:13 +0100
commit85551539f0850c9b2c83e99b69e5b53d5db22d96 (patch)
tree6dcea0199701e8b1872ac3032e1a0b1fcffff9dc /app/tasks/minetestcheck/tree.py
parent3914659718b579a6978fda9930198d1fa0e3cf59 (diff)
downloadcheatdb-85551539f0850c9b2c83e99b69e5b53d5db22d96.tar.xz
Fix incorrect game names detected by MinetestCheck
Diffstat (limited to 'app/tasks/minetestcheck/tree.py')
-rw-r--r--app/tasks/minetestcheck/tree.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/tasks/minetestcheck/tree.py b/app/tasks/minetestcheck/tree.py
index 66dcbc8..e4bfab7 100644
--- a/app/tasks/minetestcheck/tree.py
+++ b/app/tasks/minetestcheck/tree.py
@@ -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()