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

Can now set default range for startpage tiles in settings

This commit is contained in:
Krateng 2019-04-09 11:48:12 +02:00
parent 978f4f7788
commit 0439484f78
3 changed files with 14 additions and 0 deletions

View File

@ -16,3 +16,10 @@ CACHE_EXPIRE_POSITIVE = 300 # after how many days positive results should be ref
USE_LOCAL_IMAGES = true
LOCAL_IMAGE_ROTATE = 3600 # when multiple images are present locally, how many seconds we wait between rotation
[Web Interface]
# what range is shown per default for the tile view on the start page
# can be week, month, year, alltime
DEFAULT_RANGE_CHARTS_ARTISTS = year
DEFAULT_RANGE_CHARTS_TRACKS = year

View File

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

View File

@ -2,6 +2,7 @@ import urllib
from datetime import datetime, timedelta
import database
from doreah.timing import clock, clockp
from doreah.settings import get_settings
from htmlmodules import module_scrobblelist, module_pulse, module_artistcharts_tiles, module_trackcharts_tiles
@ -36,6 +37,9 @@ 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
html_scrobbles, _, _ = module_scrobblelist(max_=15,shortTimeDesc=True,pictures=True,earlystop=True)
@ -95,6 +99,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_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,