add (cached) /api/datapackage_version endpoint

This commit is contained in:
Fabian Dill 2021-07-21 23:04:22 +02:00
parent 312f13e254
commit 75bf595f86
1 changed files with 8 additions and 0 deletions

View File

@ -30,3 +30,11 @@ def room_info(room: UUID):
def get_datapackge():
from worlds import network_data_package
return network_data_package
@api_endpoints.route('/datapackage_version')
@cache.cached()
def get_datapackge_versions():
from worlds import network_data_package, AutoWorldRegister
version_package = {game: world.data_version for game, world in AutoWorldRegister.world_types.items()}
version_package["version"] = network_data_package["version"]
return version_package