mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Implemented proper range descriptions
This commit is contained in:
@@ -4,7 +4,7 @@ import database
|
||||
|
||||
def instructions(keys):
|
||||
from utilities import getArtistInfo
|
||||
from htmlgenerators import clean, artistLink, artistLinks, KeySplit
|
||||
from htmlgenerators import artistLink, artistLinks, KeySplit
|
||||
from htmlmodules import module_pulse, module_trackcharts
|
||||
|
||||
filterkeys, _, _, _ = KeySplit(keys,forceArtist=True)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Maloja - Pulse</title>
|
||||
<title>Maloja - KEY_PULSEDETAILS Pulse</title>
|
||||
<link rel="stylesheet" href="maloja.css" />
|
||||
</head>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<div style="background-image:url('KEY_IMAGEURL')"></div>
|
||||
</td>
|
||||
<td class="text">
|
||||
<h1>Pulse</h1><br/>
|
||||
<h1>KEY_PULSEDETAILS Pulse</h1><br/>
|
||||
<span>KEY_LIMITS</span>
|
||||
<!--<p class="stats">KEY_SCROBBLES Scrobbles</p>-->
|
||||
|
||||
|
||||
@@ -4,8 +4,9 @@ import database
|
||||
|
||||
def instructions(keys):
|
||||
from utilities import getArtistInfo, getTrackInfo
|
||||
from htmlgenerators import getTimeDesc, artistLink, artistLinks, trackLink, scrobblesLink, keysToUrl, getRangeDesc, KeySplit
|
||||
from htmlmodules import module_pulse
|
||||
from htmlgenerators import artistLink, artistLinks, trackLink, scrobblesLink, keysToUrl, KeySplit
|
||||
from htmlmodules import module_pulse
|
||||
from malojatime import range_desc, delimit_desc
|
||||
|
||||
filterkeys, timekeys, delimitkeys, _ = KeySplit(keys)
|
||||
|
||||
@@ -26,6 +27,10 @@ def instructions(keys):
|
||||
moreartists = data["associated"]
|
||||
if moreartists != []:
|
||||
limitstring += " <span class='extra'>including " + artistLinks(moreartists) + "</span>"
|
||||
|
||||
limitstring += " " + range_desc(**timekeys)
|
||||
|
||||
delimitstring = delimit_desc(**delimitkeys)
|
||||
|
||||
|
||||
# get image
|
||||
@@ -42,7 +47,7 @@ def instructions(keys):
|
||||
|
||||
html_pulse = module_pulse(**filterkeys,**timekeys,**delimitkeys)
|
||||
|
||||
replace = {"KEY_PULSE_TABLE":html_pulse,"KEY_IMAGEURL":imgurl,"KEY_LIMITS":limitstring}
|
||||
replace = {"KEY_PULSE_TABLE":html_pulse,"KEY_IMAGEURL":imgurl,"KEY_LIMITS":limitstring,"KEY_PULSEDETAILS":delimitstring}
|
||||
|
||||
return (replace,pushresources)
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@ import database
|
||||
def instructions(keys):
|
||||
from utilities import getArtistInfo, getTrackInfo
|
||||
from htmlgenerators import artistLink, artistLinks, trackLink, KeySplit
|
||||
from htmlmodules import module_scrobblelist
|
||||
from htmlmodules import module_scrobblelist
|
||||
from malojatime import range_desc
|
||||
|
||||
|
||||
filterkeys, timekeys, _, amountkeys = KeySplit(keys)
|
||||
@@ -24,6 +25,7 @@ def instructions(keys):
|
||||
if moreartists != []:
|
||||
limitstring += " <span class='extra'>including " + artistLinks(moreartists) + "</span>"
|
||||
|
||||
limitstring += " " + range_desc(**timekeys)
|
||||
|
||||
|
||||
html, amount, rep = module_scrobblelist(**filterkeys,**timekeys,**amountkeys)
|
||||
|
||||
@@ -7,7 +7,7 @@ from htmlmodules import module_scrobblelist, module_pulse
|
||||
|
||||
def instructions(keys):
|
||||
from utilities import getArtistsInfo, getTracksInfo
|
||||
from htmlgenerators import artistLink, artistLinks, trackLink, scrobblesArtistLink, scrobblesLink, keysToUrl, pickKeys, clean, getTimeDesc, getRangeDesc
|
||||
from htmlgenerators import artistLink, trackLink
|
||||
|
||||
max_show = 14
|
||||
posrange = ["#" + str(i) for i in range(1,max_show+1)]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Maloja - Top Artists in KEY_RANGE</title>
|
||||
<title>Maloja - Top Artists KEY_RANGE</title>
|
||||
<link rel="stylesheet" href="maloja.css" />
|
||||
</head>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</td>
|
||||
<td class="text">
|
||||
<h1>Top Artists</h1><br/>
|
||||
<span>in KEY_RANGE</span>
|
||||
<span>KEY_RANGE</span>
|
||||
<!--<p class="stats">KEY_SCROBBLES Scrobbles</p>-->
|
||||
|
||||
</td>
|
||||
|
||||
@@ -5,10 +5,15 @@ def instructions(keys):
|
||||
from utilities import getArtistInfo
|
||||
from htmlgenerators import KeySplit
|
||||
from htmlmodules import module_artistcharts
|
||||
from malojatime import range_desc
|
||||
|
||||
|
||||
_, timekeys, _, amountkeys = KeySplit(keys)
|
||||
|
||||
limitstring = range_desc(**timekeys)
|
||||
|
||||
|
||||
|
||||
html_charts, rep = module_artistcharts(**amountkeys,**timekeys)
|
||||
|
||||
if rep is not None:
|
||||
@@ -19,6 +24,6 @@ def instructions(keys):
|
||||
pushresources = [{"file":imgurl,"type":"image"}] if imgurl.startswith("/") else []
|
||||
|
||||
|
||||
replace = {"KEY_TOPARTIST_IMAGEURL":imgurl,"KEY_ARTISTLIST":html_charts}
|
||||
replace = {"KEY_TOPARTIST_IMAGEURL":imgurl,"KEY_ARTISTLIST":html_charts,"KEY_RANGE":limitstring}
|
||||
|
||||
return (replace,pushresources)
|
||||
|
||||
@@ -4,7 +4,8 @@ import urllib
|
||||
def instructions(keys):
|
||||
from utilities import getArtistInfo, getTrackInfo
|
||||
from htmlgenerators import artistLink, KeySplit
|
||||
from htmlmodules import module_trackcharts
|
||||
from htmlmodules import module_trackcharts
|
||||
from malojatime import range_desc
|
||||
|
||||
filterkeys, timekeys, _, amountkeys = KeySplit(keys)
|
||||
|
||||
@@ -22,6 +23,8 @@ def instructions(keys):
|
||||
imgurl = getTrackInfo(rep["artists"],rep["title"]).get("image")
|
||||
else:
|
||||
imgurl = ""
|
||||
|
||||
limitstring += " " + range_desc(**timekeys)
|
||||
|
||||
pushresources = [{"file":imgurl,"type":"image"}] if imgurl.startswith("/") else []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user