1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00
maloja/website/topartists.py
2019-02-21 09:43:35 +01:00

25 lines
560 B
Python

import urllib
def instructions(keys):
from utilities import getArtistInfo
from htmlgenerators import KeySplit
from htmlmodules import module_artistcharts
_, timekeys, _, amountkeys = KeySplit(keys)
html_charts, rep = module_artistcharts(**amountkeys,**timekeys)
if rep is not None:
imgurl = getArtistInfo(rep).get("image")
else:
imgurl = ""
pushresources = [{"file":imgurl,"type":"image"}] if imgurl.startswith("/") else []
replace = {"KEY_TOPARTIST_IMAGEURL":imgurl,"KEY_ARTISTLIST":html_charts}
return (replace,pushresources)