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

Added setting for default pulse as well

This commit is contained in:
Krateng 2019-04-09 11:56:09 +02:00
parent 0439484f78
commit 7d04ea3953
3 changed files with 11 additions and 4 deletions

View File

@ -23,3 +23,6 @@ LOCAL_IMAGE_ROTATE = 3600 # when multiple images are present locally, how many s
# can be week, month, year, alltime
DEFAULT_RANGE_CHARTS_ARTISTS = year
DEFAULT_RANGE_CHARTS_TRACKS = year
# same for pulse view
# can be days, weeks, months, years
DEFAULT_RANGE_PULSE = months

View File

@ -22,7 +22,7 @@
document.getElementById("selector_" + identifier + "_" + unit).setAttribute("style","opacity:0.5;")
}
document.addEventListener('DOMContentLoaded',function() {KEY_JS_INIT_TILES})
document.addEventListener('DOMContentLoaded',function() {KEY_JS_INIT_RANGES})
</script>
</head>

View File

@ -9,6 +9,11 @@ from htmlmodules import module_scrobblelist, module_pulse, module_artistcharts_t
def instructions(keys):
# commands to execute on load for default ranges
js_command = "showRange('topartists','" + get_settings("DEFAULT_RANGE_CHARTS_ARTISTS") + "');"
js_command += "showRange('toptracks','" + get_settings("DEFAULT_RANGE_CHARTS_TRACKS") + "');"
js_command += "showRange('pulse','" + get_settings("DEFAULT_RANGE_PULSE") + "');"
# get start of week
tod = datetime.utcnow()
change = (tod.weekday() + 1) % 7
@ -37,8 +42,7 @@ def instructions(keys):
clockp("Tracks")
js_command = "showRange('topartists','" + get_settings("DEFAULT_RANGE_CHARTS_ARTISTS") + "');"
js_command += "showRange('toptracks','" + get_settings("DEFAULT_RANGE_CHARTS_TRACKS") + "');"
# scrobbles
@ -99,7 +103,7 @@ def instructions(keys):
# "KEY_PULSE_TERM":pulse_rangedescs,"KEY_PULSE_AMOUNT":pulse_amounts,"KEY_PULSE_BAR":pulse_bars
"KEY_TOPARTISTS_TOTAL":topartists_total,"KEY_TOPARTISTS_YEAR":topartists_year,"KEY_TOPARTISTS_MONTH":topartists_month,"KEY_TOPARTISTS_WEEK":topartists_week,
"KEY_TOPTRACKS_TOTAL":toptracks_total,"KEY_TOPTRACKS_YEAR":toptracks_year,"KEY_TOPTRACKS_MONTH":toptracks_month,"KEY_TOPTRACKS_WEEK":toptracks_week,
"KEY_JS_INIT_TILES":js_command,
"KEY_JS_INIT_RANGES":js_command,
"KEY_SCROBBLE_NUM_TODAY":scrobbles_today,"KEY_SCROBBLE_NUM_MONTH":scrobbles_month,"KEY_SCROBBLE_NUM_YEAR":scrobbles_year,"KEY_SCROBBLE_NUM_TOTAL":scrobbles_total,
"KEY_SCROBBLES":html_scrobbles,
"KEY_PULSE_MONTHS":html_pulse_months,"KEY_PULSE_YEARS":html_pulse_years,"KEY_PULSE_DAYS":html_pulse_days,"KEY_PULSE_WEEKS":html_pulse_weeks,