Fix various issues

This commit is contained in:
rubenwardy 2018-12-21 14:02:57 +00:00
parent e5b279d013
commit dd368d87aa
4 changed files with 9 additions and 8 deletions

View File

@ -406,7 +406,7 @@ class Package(db.Model):
"author": self.author.display_name, "author": self.author.display_name,
"name": self.name, "name": self.name,
"title": self.title, "title": self.title,
"short_descriptionesc": self.shortDesc, "short_description": self.shortDesc,
"desc": self.desc, "desc": self.desc,
"type": self.type.toName(), "type": self.type.toName(),
"created_at": self.created_at, "created_at": self.created_at,

View File

@ -74,7 +74,7 @@ def parseTitle(title):
def getLinksFromModSearch(): def getLinksFromModSearch():
links = {} links = {}
contents = urllib.request.urlopen("http://krock-works.16mb.com/MTstuff/modList.php").read().decode("utf-8") contents = urllib.request.urlopen("https://krock-works.uk.to/minetest/modList.php").read().decode("utf-8")
for x in json.loads(contents): for x in json.loads(contents):
link = x.get("link") link = x.get("link")
if link is not None: if link is not None:
@ -127,15 +127,15 @@ def importTopicList():
link = links_by_id.get(id) link = links_by_id.get(id)
# Fill row # Fill row
topic.topic_id = id topic.topic_id = int(id)
topic.author = user topic.author = user
topic.type = info["type"] topic.type = info["type"]
topic.title = title topic.title = title
topic.name = name topic.name = name
topic.link = link topic.link = link
topic.wip = info["wip"] topic.wip = info["wip"]
topic.posts = info["posts"] topic.posts = int(info["posts"])
topic.views = info["views"] topic.views = int(info["views"])
topic.created_at = info["date"] topic.created_at = info["date"]
for p in Package.query.all(): for p in Package.query.all():

View File

@ -66,7 +66,7 @@ def getKrockList():
global krock_list_cache_by_name global krock_list_cache_by_name
if krock_list_cache is None: if krock_list_cache is None:
contents = urllib.request.urlopen("http://krock-works.16mb.com/MTstuff/modList.php").read().decode("utf-8") contents = urllib.request.urlopen("https://krock-works.uk.to/minetest/modList.php").read().decode("utf-8")
list = json.loads(contents) list = json.loads(contents)
def h(x): def h(x):
@ -149,7 +149,8 @@ class PackageTreeNode:
type = PackageType.GAME type = PackageType.GAME
elif os.path.isfile(baseDir + "/init.lua"): elif os.path.isfile(baseDir + "/init.lua"):
type = PackageType.MOD type = PackageType.MOD
elif os.path.isfile(baseDir + "/modpack.txt"): elif os.path.isfile(baseDir + "/modpack.txt") or \
os.path.isfile(baseDir + "/modpack.conf"):
type = PackageType.MOD type = PackageType.MOD
is_modpack = True is_modpack = True
elif os.path.isdir(baseDir + "/mods"): elif os.path.isdir(baseDir + "/mods"):

View File

@ -6,7 +6,7 @@ Flask-Menu>=0.7.0
Flask-Markdown>=0.3 Flask-Markdown>=0.3
GitHub-Flask>=3.2.0 GitHub-Flask>=3.2.0
pyScss==1.3.4 pyScss==1.3.4
celery==4.0.2 celery==4.1.1
redis==2.10.6 redis==2.10.6
beautifulsoup4==4.6.0 beautifulsoup4==4.6.0
lxml==4.2.1 lxml==4.2.1