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

30 lines
652 B
Python
Raw Normal View History

2018-12-17 18:33:26 +03:00
import urllib
def instructions(keys):
2019-03-12 13:39:36 +03:00
from utilities import getArtistImage
from htmlgenerators import KeySplit
from htmlmodules import module_artistcharts
2019-03-03 00:55:22 +03:00
from malojatime import range_desc
_, timekeys, _, amountkeys = KeySplit(keys)
2018-12-17 18:33:26 +03:00
2019-03-03 00:55:22 +03:00
limitstring = range_desc(**timekeys)
html_charts, rep = module_artistcharts(**amountkeys,**timekeys)
if rep is not None:
2019-03-12 13:39:36 +03:00
imgurl = getArtistImage(rep)
else:
imgurl = ""
pushresources = [{"file":imgurl,"type":"image"}] if imgurl.startswith("/") else []
2018-12-17 18:33:26 +03:00
2019-03-03 00:55:22 +03:00
replace = {"KEY_TOPARTIST_IMAGEURL":imgurl,"KEY_ARTISTLIST":html_charts,"KEY_RANGE":limitstring}
2018-12-17 18:33:26 +03:00
return (replace,pushresources)