background fades to new color, new left side menu (WIP)
This commit is contained in:
@@ -4,7 +4,6 @@ from urllib.parse import urlencode
|
||||
import base64
|
||||
import os
|
||||
import _canvas as SpotifyCanvas
|
||||
import time
|
||||
import syncedlyrics
|
||||
|
||||
dev = 0
|
||||
@@ -92,7 +91,6 @@ def callback():
|
||||
@app.route('/appdata')
|
||||
def appdata():
|
||||
global access_token
|
||||
stime = time.time()
|
||||
try:
|
||||
user_headers = {
|
||||
"Authorization": "Bearer " + access_token,
|
||||
@@ -107,11 +105,9 @@ def appdata():
|
||||
if currently_playing.content:
|
||||
if "is_playing" in currently_playing.json():
|
||||
if currently_playing.json()["is_playing"] is True and currently_playing.json()["item"]["id"] == request.args.get('id'):
|
||||
print("QUICK" + str(time.time() - stime))
|
||||
return { 'progress_ms': currently_playing.json()["progress_ms"],
|
||||
}
|
||||
elif currently_playing.json()["is_playing"] is True and currently_playing.json()["item"]["id"] != request.args.get('id'):
|
||||
print("FULL" + str(time.time() - stime))
|
||||
return { 'id': currently_playing.json()["item"]["id"],
|
||||
'name': currently_playing.json()["item"]["name"],
|
||||
'artist': currently_playing.json()["item"]["artists"][0]["name"],
|
||||
@@ -171,7 +167,6 @@ def icons(filename):
|
||||
|
||||
@app.route('/canvas')
|
||||
def canvas():
|
||||
print("CANVAS")
|
||||
id = request.args.get('id')
|
||||
try:
|
||||
return { 'canvas_url': SpotifyCanvas.get_canvas_for_track(SpotifyCanvas.get_access_token(), id) }
|
||||
@@ -184,10 +179,10 @@ def lyrics():
|
||||
artist = request.args.get('artist')
|
||||
if name and artist is not None:
|
||||
full_lyrics = syncedlyrics.search("[" + name + "] [" + artist + "]")
|
||||
if full_lyrics is None:
|
||||
return { 'lyrics': "no lyrics" }
|
||||
else:
|
||||
return { 'lyrics': '' }
|
||||
if full_lyrics is None:
|
||||
return { 'lyrics': "no lyrics" }
|
||||
return { 'lyrics': full_lyrics }
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user