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

Pulse / performance range selector now also for tracks

This commit is contained in:
Krateng
2019-05-01 11:20:40 +02:00
parent 360bc97610
commit a908a5e6a3
2 changed files with 45 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
import urllib
import database
from malojatime import today,thisweek,thismonth,thisyear
def instructions(keys):
@@ -40,6 +41,17 @@ def instructions(keys):
html_pulse = module_pulse(track=track,step="year",stepn=1,trail=1)
html_performance = module_performance(track=track,step="year",stepn=1,trail=1)
# pulse and rankings
html_pulse_days = module_pulse(track=track,max_=7,since=today().next(-6),step="day",trail=1)
html_pulse_weeks = module_pulse(track=track,max_=12,since=thisweek().next(-11),step="week",trail=1)
html_pulse_months = module_pulse(track=track,max_=12,since=thismonth().next(-11),step="month",trail=1)
html_pulse_years = module_pulse(track=track,max_=10,since=thisyear().next(-9),step="year",trail=1)
html_performance_days = module_performance(track=track,max_=7,since=today().next(-6),step="day",trail=1)
html_performance_weeks = module_performance(track=track,max_=12,since=thisweek().next(-11),step="week",trail=1)
html_performance_months = module_performance(track=track,max_=12,since=thismonth().next(-11),step="month",trail=1)
html_performance_years = module_performance(track=track,max_=10,since=thisyear().next(-9),step="year",trail=1)
replace = {
"KEY_TRACKTITLE":track.get("title"),
@@ -50,8 +62,16 @@ def instructions(keys):
"KEY_SCROBBLELINK":compose_querystring(keys),
"KEY_MEDALS":html_medals,
"KEY_SCROBBLELIST":html_scrobbles,
"KEY_PULSE":html_pulse,
"KEY_PERFORMANCE":html_performance
# pulse
"KEY_PULSE_MONTHS":html_pulse_months,
"KEY_PULSE_YEARS":html_pulse_years,
"KEY_PULSE_DAYS":html_pulse_days,
"KEY_PULSE_WEEKS":html_pulse_weeks,
# performance
"KEY_PERFORMANCE_MONTHS":html_performance_months,
"KEY_PERFORMANCE_YEARS":html_performance_years,
"KEY_PERFORMANCE_DAYS":html_performance_days,
"KEY_PERFORMANCE_WEEKS":html_performance_weeks,
}
return (replace,pushresources)