mirror of
https://github.com/Xevion/v1.xevion.dev.git
synced 2025-12-07 05:16:58 -06:00
updated Spotify to have a CACHE TIME config constant var, moved tracks folder to export inside Spotify explicit folder
the tracks folder was relative of the main WSGI python file due to me using my sys.path[0] method of finding the current folder the file was in, unfortunately this ends up being unreliable when put into practice
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from app import app
|
||||
from config import Config
|
||||
from flask import send_from_directory, redirect, url_for, render_template, send_file
|
||||
import json
|
||||
import subprocess
|
||||
@@ -21,10 +22,10 @@ def check_and_update():
|
||||
else:
|
||||
dif = time.time() - file['last_generated']
|
||||
# print('dif', dif)
|
||||
if dif >= 3600:
|
||||
if dif >= Config.SPOTIFY_CACHE_TIME:
|
||||
return True
|
||||
else:
|
||||
ideal = file['last_generated'] + 3600
|
||||
ideal = file['last_generated'] + Config.SPOTIFY_CACHE_TIME
|
||||
# print(f'Waiting another {int(ideal - time.time())} seconds')
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user