mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-10 01:23:48 +01:00
parent
31a748b0b3
commit
65e8929689
@ -667,15 +667,18 @@ def game_support(package):
|
||||
detect_update_needed = False
|
||||
|
||||
if current_user not in package.maintainers:
|
||||
resolver = GameSupportResolver(db.session)
|
||||
try:
|
||||
resolver = GameSupportResolver(db.session)
|
||||
|
||||
game_is_supported = {}
|
||||
for game in get_games_from_csv(db.session, form.supported.data or ""):
|
||||
game_is_supported[game.id] = True
|
||||
for game in get_games_from_csv(db.session, form.unsupported.data or ""):
|
||||
game_is_supported[game.id] = False
|
||||
resolver.set_supported(package, game_is_supported, 11)
|
||||
detect_update_needed = True
|
||||
game_is_supported = {}
|
||||
for game in get_games_from_csv(db.session, form.supported.data or ""):
|
||||
game_is_supported[game.id] = True
|
||||
for game in get_games_from_csv(db.session, form.unsupported.data or ""):
|
||||
game_is_supported[game.id] = False
|
||||
resolver.set_supported(package, game_is_supported, 11)
|
||||
detect_update_needed = True
|
||||
except LogicError as e:
|
||||
flash(e.message, "danger")
|
||||
|
||||
next_url = package.getURL("packages.game_support")
|
||||
|
||||
|
@ -146,18 +146,21 @@ def postReleaseCheckUpdate(self, release: PackageRelease, path):
|
||||
|
||||
# Update game support
|
||||
if package.type == PackageType.MOD:
|
||||
resolver = GameSupportResolver(db.session)
|
||||
try:
|
||||
resolver = GameSupportResolver(db.session)
|
||||
|
||||
game_is_supported = {}
|
||||
if "supported_games" in tree.meta:
|
||||
for game in get_games_from_csv(db.session, tree.meta["supported_games"]):
|
||||
game_is_supported[game.id] = True
|
||||
if "unsupported_games" in tree.meta:
|
||||
for game in get_games_from_csv(db.session, tree.meta["unsupported_games"]):
|
||||
game_is_supported[game.id] = False
|
||||
game_is_supported = {}
|
||||
if "supported_games" in tree.meta:
|
||||
for game in get_games_from_csv(db.session, tree.meta["supported_games"]):
|
||||
game_is_supported[game.id] = True
|
||||
if "unsupported_games" in tree.meta:
|
||||
for game in get_games_from_csv(db.session, tree.meta["unsupported_games"]):
|
||||
game_is_supported[game.id] = False
|
||||
|
||||
resolver.set_supported(package, game_is_supported, 10)
|
||||
resolver.update(package)
|
||||
resolver.set_supported(package, game_is_supported, 10)
|
||||
resolver.update(package)
|
||||
except LogicError as e:
|
||||
raise TaskError(e.message)
|
||||
|
||||
return tree
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user