added animated fading background
This commit is contained in:
@@ -104,31 +104,32 @@ def appdata():
|
||||
currently_playing = requests.get("https://api.spotify.com/v1/me/player/currently-playing", headers=user_headers)
|
||||
|
||||
if currently_playing.content:
|
||||
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"],
|
||||
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"],
|
||||
'album': currently_playing.json()["item"]["album"]["name"],
|
||||
'image': currently_playing.json()["item"]["album"]["images"][0]["url"],
|
||||
'is_playing': currently_playing.json()["is_playing"],
|
||||
'progress_ms': currently_playing.json()["progress_ms"],
|
||||
'duration_ms': currently_playing.json()["item"]["duration_ms"],
|
||||
'is_liked': requests.get("https://api.spotify.com/v1/me/tracks/contains?ids=" + currently_playing.json()["item"]["id"], headers=user_headers).json()[0],
|
||||
'canvas': False,
|
||||
'gofetch': 'fetch'
|
||||
}
|
||||
elif currently_playing.json()["is_playing"] is False:
|
||||
return { 'is_playing': False
|
||||
}
|
||||
else:
|
||||
return { 'name': "Error",
|
||||
'artist': "Error"
|
||||
}
|
||||
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"],
|
||||
'album': currently_playing.json()["item"]["album"]["name"],
|
||||
'image': currently_playing.json()["item"]["album"]["images"][0]["url"],
|
||||
'is_playing': currently_playing.json()["is_playing"],
|
||||
'progress_ms': currently_playing.json()["progress_ms"],
|
||||
'duration_ms': currently_playing.json()["item"]["duration_ms"],
|
||||
'is_liked': requests.get("https://api.spotify.com/v1/me/tracks/contains?ids=" + currently_playing.json()["item"]["id"], headers=user_headers).json()[0],
|
||||
'canvas': False,
|
||||
'fetchlyrics': 'fetch'
|
||||
}
|
||||
elif currently_playing.json()["is_playing"] is False:
|
||||
return { 'is_playing': False
|
||||
}
|
||||
else:
|
||||
return { 'name': "Error",
|
||||
'artist': "Error"
|
||||
}
|
||||
else:
|
||||
return { 'is_playing': False
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user