1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Changed way of serving third-party images to improve page loading time

This commit is contained in:
Krateng
2019-02-20 21:10:58 +01:00
parent 5f19e7b38e
commit f1007d6da5
10 changed files with 76 additions and 46 deletions

View File

@ -348,4 +348,15 @@ def getArtistsInfo(artistlist):
# async calls only cached results, now we need to get them
return [getArtistInfo(a) for a in artistlist]
# new way of serving images
# instead always generate a link locally, but redirect that on the fly
# this way the page can load faster and images will trickle in without having to resort to XHTTP requests
def resolveImage(artist=None,track=None):
if track is not None:
return getTrackInfo(track["artists"],track["title"])["image"]
elif artist is not None:
return getArtistInfo(artist)["image"]