Themes and Templates (#1)

* Update templates.json

* Update templates.json

* Update templates.json

* Update spotify.py

* Update spotify.py

* Update spotify.py

* Update spotify.py

* Update spotify.py

* Update spotify.py

* Update spotify.py

* Update spotify.py

* Update spotify.py

* Update templates.json
This commit is contained in:
Ethan Shoham
2021-07-11 09:32:35 +03:00
committed by Andrew Novac
parent c63a193ed8
commit a301a69078
2 changed files with 5 additions and 4 deletions

View File

@@ -86,10 +86,11 @@ def barGen(barCount):
def getTemplate(): def getTemplate():
try: try:
file = open("templates.json",) file = open("api/templates.json","r")
templates = json.load(file) templates = json.loads(file.read())
return templates["templates"][templates["current-theme"]] return templates["templates"][templates["current-theme"]]
except: except Exception as e:
print(f"Failed to load templates.")
return FALLBACK_THEME return FALLBACK_THEME

View File

@@ -4,4 +4,4 @@
"light": "spotify.html.j2", "light": "spotify.html.j2",
"dark": "spotify-dark.html.j2" "dark": "spotify-dark.html.j2"
} }
} }