~cadence/crumpet

aaa8325e873759e4d96ab8b2740b2d1ed9c508ec — Cadence Ember 10 months ago f44e5d4
Expose data source
1 files changed, 4 insertions(+), 0 deletions(-)

M crumpet.py
M crumpet.py => crumpet.py +4 -0
@@ 126,17 126,21 @@ class Crumpet:
	@cherrypy.tools.json_out()
	def get_paths(self):
		# Check game directory
		source = "configuration"
		game_directory = db["game_directory"]
		if game_directory:
			game_path = pathlib.Path(game_directory)
			problem = check_game_path(game_path)
			if problem:
				source = "autodetect"
				game_directory = autodetect_game_directory()
		else:
			source = "autodetect"
			game_directory = autodetect_game_directory()
		# do not need to check customlevels directory since the interface should replace whatever is sent.
		customlevels_directory = db["customlevels_directory"]
		return {
			"source": source,
			"game_directory": game_directory,
			"customlevels_directory": customlevels_directory
		}