WebHost: make a deeply buried if tree for games a bit more automatic

This commit is contained in:
Fabian Dill
2022-07-27 12:01:26 +02:00
committed by black-sliver
parent d817fdcfdb
commit 2ff7e83ad9
2 changed files with 5 additions and 1 deletions

View File

@@ -69,6 +69,10 @@ class B64UUIDConverter(BaseConverter):
app.url_map.converters["suuid"] = B64UUIDConverter
app.jinja_env.filters['suuid'] = lambda value: base64.urlsafe_b64encode(value.bytes).rstrip(b'=').decode('ascii')
# has automatic patch integration
import Patch
app.jinja_env.filters['supports_apdeltapatch'] = lambda game_name: game_name in Patch.AutoPatchRegister.patch_types
def get_world_theme(game_name: str):
if game_name in AutoWorldRegister.world_types: