mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Display latest scrobbles for artists as well as tracks
This commit is contained in:
parent
5a575b9457
commit
8b8470439c
@ -32,5 +32,8 @@
|
|||||||
<h2><a href='/pulse?artist=KEY_ENC_ARTISTNAME&step=year&trail=1'>Pulse</a></h2>
|
<h2><a href='/pulse?artist=KEY_ENC_ARTISTNAME&step=year&trail=1'>Pulse</a></h2>
|
||||||
KEY_PULSE
|
KEY_PULSE
|
||||||
|
|
||||||
|
<h2><a href='/scrobbles?KEY_SCROBBLELINK'>Last Scrobbles</a></h2>
|
||||||
|
KEY_SCROBBLELIST
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -6,9 +6,10 @@ def instructions(keys):
|
|||||||
from utilities import getArtistImage
|
from utilities import getArtistImage
|
||||||
from htmlgenerators import artistLink, artistLinks
|
from htmlgenerators import artistLink, artistLinks
|
||||||
from urihandler import compose_querystring, uri_to_internal
|
from urihandler import compose_querystring, uri_to_internal
|
||||||
from htmlmodules import module_pulse, module_trackcharts
|
from htmlmodules import module_pulse, module_trackcharts, module_scrobblelist
|
||||||
|
|
||||||
filterkeys, _, _, _ = uri_to_internal(keys,forceArtist=True)
|
filterkeys, _, _, _ = uri_to_internal(keys,forceArtist=True)
|
||||||
|
artist = filterkeys.get("artist")
|
||||||
imgurl = getArtistImage(filterkeys["artist"],fast=True)
|
imgurl = getArtistImage(filterkeys["artist"],fast=True)
|
||||||
pushresources = [{"file":imgurl,"type":"image"}] if imgurl.startswith("/") else []
|
pushresources = [{"file":imgurl,"type":"image"}] if imgurl.startswith("/") else []
|
||||||
|
|
||||||
@ -41,13 +42,23 @@ def instructions(keys):
|
|||||||
|
|
||||||
html_tracks, _ = module_trackcharts(**filterkeys,max_=15)
|
html_tracks, _ = module_trackcharts(**filterkeys,max_=15)
|
||||||
|
|
||||||
|
html_scrobbles, _, _ = module_scrobblelist(artist=artist,max_=10,earlystop=True)
|
||||||
|
|
||||||
html_pulse = module_pulse(**filterkeys,step="year",stepn=1,trail=1)
|
html_pulse = module_pulse(**filterkeys,step="year",stepn=1,trail=1)
|
||||||
|
|
||||||
replace = {"KEY_ARTISTNAME":keys["artist"],"KEY_ENC_ARTISTNAME":urllib.parse.quote(keys["artist"]),
|
replace = {
|
||||||
"KEY_IMAGEURL":imgurl, "KEY_DESCRIPTION":"","KEY_MEDALS":html_medals,
|
"KEY_ARTISTNAME":keys["artist"],
|
||||||
"KEY_TRACKLIST":html_tracks,"KEY_PULSE":html_pulse,
|
"KEY_ENC_ARTISTNAME":urllib.parse.quote(keys["artist"]),
|
||||||
"KEY_SCROBBLES":scrobbles,"KEY_POSITION":pos,
|
"KEY_IMAGEURL":imgurl,
|
||||||
"KEY_ASSOCIATED":includestr}
|
"KEY_DESCRIPTION":"",
|
||||||
|
"KEY_MEDALS":html_medals,
|
||||||
|
"KEY_TRACKLIST":html_tracks,
|
||||||
|
"KEY_PULSE":html_pulse,
|
||||||
|
"KEY_SCROBBLES":scrobbles,
|
||||||
|
"KEY_SCROBBLELIST":html_scrobbles,
|
||||||
|
"KEY_SCROBBLELINK":compose_querystring(keys),
|
||||||
|
"KEY_POSITION":pos,
|
||||||
|
"KEY_ASSOCIATED":includestr
|
||||||
|
}
|
||||||
|
|
||||||
return (replace,pushresources)
|
return (replace,pushresources)
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
KEY_PULSE
|
KEY_PULSE
|
||||||
|
|
||||||
|
|
||||||
<h2><a href='/scrobbles?KEY_SCROBBLELINK'>Scrobbles</a></h2>
|
<h2><a href='/scrobbles?KEY_SCROBBLELINK'>Last Scrobbles</a></h2>
|
||||||
KEY_SCROBBLELIST
|
KEY_SCROBBLELIST
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,13 +35,21 @@ def instructions(keys):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
html_scrobbles, _, _ = module_scrobblelist(track=track,max_=100,earlystop=True) # we have the number already from the trackinfo
|
html_scrobbles, _, _ = module_scrobblelist(track=track,max_=10,earlystop=True) # we have the number already from the trackinfo
|
||||||
|
|
||||||
html_pulse = module_pulse(track=track,step="year",stepn=1,trail=1)
|
html_pulse = module_pulse(track=track,step="year",stepn=1,trail=1)
|
||||||
|
|
||||||
|
|
||||||
replace = {"KEY_TRACKTITLE":track.get("title"),"KEY_ARTISTS":artistLinks(track.get("artists")),"KEY_SCROBBLES":scrobblesnum,"KEY_POSITION":pos,"KEY_IMAGEURL":imgurl,
|
replace = {
|
||||||
"KEY_SCROBBLELINK":compose_querystring(keys),"KEY_MEDALS":html_medals,
|
"KEY_TRACKTITLE":track.get("title"),
|
||||||
"KEY_SCROBBLELIST":html_scrobbles,"KEY_PULSE":html_pulse}
|
"KEY_ARTISTS":artistLinks(track.get("artists")),
|
||||||
|
"KEY_SCROBBLES":scrobblesnum,
|
||||||
|
"KEY_POSITION":pos,
|
||||||
|
"KEY_IMAGEURL":imgurl,
|
||||||
|
"KEY_SCROBBLELINK":compose_querystring(keys),
|
||||||
|
"KEY_MEDALS":html_medals,
|
||||||
|
"KEY_SCROBBLELIST":html_scrobbles,
|
||||||
|
"KEY_PULSE":html_pulse
|
||||||
|
}
|
||||||
|
|
||||||
return (replace,pushresources)
|
return (replace,pushresources)
|
||||||
|
Loading…
Reference in New Issue
Block a user