mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-23 06:22:24 +01:00
Fix missing mapPackages
This commit is contained in:
parent
13b6ab04bb
commit
b87401a0c8
@ -388,7 +388,7 @@ def homepage():
|
||||
return {
|
||||
"count": count,
|
||||
"downloads": downloads,
|
||||
"featured": featured,
|
||||
"featured": mapPackages(featured),
|
||||
"new": mapPackages(new),
|
||||
"updated": mapPackages(updated),
|
||||
"pop_mod": mapPackages(pop_mod),
|
||||
|
@ -70,23 +70,6 @@ def getMeta(urlstr, author):
|
||||
return result
|
||||
|
||||
|
||||
def get_edit_data_from_dir(dir: str):
|
||||
data = {}
|
||||
for path in [os.path.join(dir, ".cdb.json"), os.path.join(dir, ".cdb", "meta.json")]:
|
||||
if os.path.isfile(path):
|
||||
with open(path, "r") as f:
|
||||
data = json.loads(f.read())
|
||||
break
|
||||
|
||||
for path in [os.path.join(dir, ".cdb.md"), os.path.join(dir, ".cdb", "long_description.md")]:
|
||||
if os.path.isfile(path):
|
||||
with open(path, "r") as f:
|
||||
data["long_description"] = f.read().replace("\r\n", "\n")
|
||||
break
|
||||
|
||||
return data
|
||||
|
||||
|
||||
def postReleaseCheckUpdate(self, release: PackageRelease, path):
|
||||
try:
|
||||
tree = build_tree(path, expected_type=ContentType[release.package.type.name],
|
||||
@ -134,11 +117,13 @@ def postReleaseCheckUpdate(self, release: PackageRelease, path):
|
||||
release.max_rel = MinetestRelease.get(tree.meta["max_minetest_version"], None)
|
||||
|
||||
try:
|
||||
data = get_edit_data_from_dir(tree.baseDir)
|
||||
if data != {}: # Not sure if this will actually work to check not empty, probably not
|
||||
with open(os.path.join(tree.baseDir, ".cdb.json"), "r") as f:
|
||||
data = json.loads(f.read())
|
||||
do_edit_package(package.author, package, False, data, "Post release hook")
|
||||
except LogicError as e:
|
||||
raise TaskError(e.message)
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
return tree
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user