mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Somewhat more sensible naming for web views
This commit is contained in:
39
website/top_artists.py
Normal file
39
website/top_artists.py
Normal file
@@ -0,0 +1,39 @@
|
||||
import urllib
|
||||
|
||||
|
||||
def instructions(keys):
|
||||
from utilities import getArtistImage, getTrackImage
|
||||
from htmlgenerators import artistLink, KeySplit
|
||||
from htmlmodules import module_topartists, module_filterselection
|
||||
from malojatime import range_desc
|
||||
|
||||
_, timekeys, delimitkeys, _ = KeySplit(keys)
|
||||
|
||||
|
||||
limitstring = ""
|
||||
|
||||
html_filterselector = module_filterselection(keys,delimit=True)
|
||||
|
||||
html_charts, rep = module_topartists(**timekeys, **delimitkeys)
|
||||
|
||||
|
||||
#if filterkeys.get("artist") is not None:
|
||||
# imgurl = getArtistImage(filterkeys.get("artist"))
|
||||
# limitstring = "by " + artistLink(filterkeys.get("artist"))
|
||||
if rep is not None:
|
||||
imgurl = getArtistImage(rep)
|
||||
else:
|
||||
imgurl = ""
|
||||
|
||||
limitstring += " " + range_desc(**timekeys)
|
||||
|
||||
pushresources = [{"file":imgurl,"type":"image"}] if imgurl.startswith("/") else []
|
||||
|
||||
|
||||
|
||||
replace = {"KEY_TOPARTIST_IMAGEURL":imgurl,
|
||||
"KEY_ARTISTLIST":html_charts,
|
||||
"KEY_LIMITS":limitstring,
|
||||
"KEY_FILTERSELECTOR":html_filterselector}
|
||||
|
||||
return (replace,pushresources)
|
||||
Reference in New Issue
Block a user