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

Added debug output to evaluate PyHP performance

This commit is contained in:
Krateng
2019-11-21 06:31:23 +01:00
parent ab7ca8f192
commit 1c9fdedbed
5 changed files with 19 additions and 13 deletions

View File

@@ -70,9 +70,9 @@
</pyhp></span>
<!-- CERTS -->
<pyhp for="track" in="db.get_tracks(artist=artist)"><pyhp if="db.trackInfo(track).get('certification') is not None"><a href='{htmlgenerators.link_address(track)}'><img class="certrecord_small"
src="/media/record_{db.trackInfo(track)['certification']}.png"
title="{track['title']} has reached {db.trackInfo(track)['certification'].capitalize()} status"
<pyhp for="track" in="db.get_tracks(artist=artist)"><pyhp save="db.trackInfo(track)" as="info" /><pyhp if="info.get('certification') is not None"><a href='{htmlgenerators.link_address(track)}'><img class="certrecord_small"
src="/media/record_{info['certification']}.png"
title="{track['title']} has reached {info['certification'].capitalize()} status"
/></a></pyhp></pyhp>

View File

@@ -15,7 +15,7 @@ def instructions(keys):
js_command += "showRange('pulse','" + get_settings("DEFAULT_STEP_PULSE") + "');"
clock()
#clock()
from malojatime import today,thisweek,thismonth,thisyear
@@ -26,7 +26,7 @@ def instructions(keys):
topartists_month = module_artistcharts_tiles(timerange=thismonth())
topartists_week = module_artistcharts_tiles(timerange=thisweek())
clockp("Artists")
#clockp("Artists")
# tracks
@@ -36,7 +36,7 @@ def instructions(keys):
toptracks_week = module_trackcharts_tiles(timerange=thisweek())
clockp("Tracks")
#clockp("Tracks")
@@ -44,7 +44,7 @@ def instructions(keys):
# scrobbles
html_scrobbles, _, _ = module_scrobblelist(max_=15,shortTimeDesc=True,pictures=True,earlystop=True)
clockp("Scrobbles")
#clockp("Scrobbles")
# stats
@@ -63,7 +63,7 @@ def instructions(keys):
amount_total = database.get_scrobbles_num()
scrobbles_total = "<a href='/scrobbles'>" + str(amount_total) + "</a>"
clockp("Amounts")
#clockp("Amounts")
# pulse
@@ -78,7 +78,7 @@ def instructions(keys):
#html_pulse_month = module_pulse(max_=30,since=[dt.year,dt.month],step="day",trail=1)
#html_pulse_year = module_pulse(max_=12,since=[dt.year],step="month",trail=1)
clockp("Pulse")
#clockp("Pulse")
#pushresources = [{"file":img,"type":"image"} for img in artistimages + trackimages] #can't push scrobble images as we don't get them from the module function, need to think about that
pushresources = []