mirror of
https://github.com/Xevion/v1.xevion.dev.git
synced 2025-12-07 09:16:56 -06:00
fixed location of where tracks where saved (sys.path error), image should now be built upon correct, most recent data
This commit is contained in:
@@ -11,11 +11,11 @@ from .spotify_explicit import main
|
||||
path = os.path.join('app/spotify_explicit/recent.json')
|
||||
|
||||
def check_and_update():
|
||||
with open(path) as file:
|
||||
try:
|
||||
try:
|
||||
with open(path) as file:
|
||||
file = json.load(file)
|
||||
except json.JSONDecodeError:
|
||||
file = {'last_generated' : -1}
|
||||
except (FileNotFoundError, json.JSONDecodeError):
|
||||
file = {'last_generated' : -1}
|
||||
|
||||
if file['last_generated'] == -1:
|
||||
return True
|
||||
@@ -33,7 +33,7 @@ def check_and_update():
|
||||
def spotify():
|
||||
if check_and_update():
|
||||
print('Graph out of date - running update command')
|
||||
with open(path, 'w') as file:
|
||||
with open(path, 'w+') as file:
|
||||
file = json.dump({'last_generated' : int(time.time())}, file)
|
||||
main.main()
|
||||
return send_file('spotify_explicit/export/export.png')
|
||||
Reference in New Issue
Block a user