diff --git a/api/spotify.py b/api/spotify.py index 67ab32f..efba289 100644 --- a/api/spotify.py +++ b/api/spotify.py @@ -86,10 +86,11 @@ def barGen(barCount): def getTemplate(): try: - file = open("templates.json",) - templates = json.load(file) + file = open("api/templates.json","r") + templates = json.loads(file.read()) return templates["templates"][templates["current-theme"]] - except: + except Exception as e: + print(f"Failed to load templates.") return FALLBACK_THEME diff --git a/api/templates.json b/api/templates.json index 94f34fe..a0d08ee 100644 --- a/api/templates.json +++ b/api/templates.json @@ -4,4 +4,4 @@ "light": "spotify.html.j2", "dark": "spotify-dark.html.j2" } -} \ No newline at end of file +}