mirror of
https://github.com/krateng/maloja.git
synced 2025-04-16 16:52:18 +03:00
Some cleanup
This commit is contained in:
parent
ad9cad9e94
commit
56030acf0e
@ -422,6 +422,7 @@ def get_charts_tracks(dbconn=None,resolve_ids=True,**keys):
|
||||
|
||||
@waitfordb
|
||||
def get_charts_albums(dbconn=None,resolve_ids=True,only_own_albums=False,**keys):
|
||||
# TODO: different scrobble numbers for only own tracks on own album etc?
|
||||
(since,to) = keys.get('timerange').timestamps()
|
||||
|
||||
if 'artist' in keys:
|
||||
|
@ -26,8 +26,6 @@ def update_jinja_environment():
|
||||
|
||||
JINJA_CONTEXT = {
|
||||
# maloja
|
||||
"db": database, #TODO: move these to connection manager as well
|
||||
#"dbp":dbp,
|
||||
"malojatime": malojatime,
|
||||
"images": images,
|
||||
"mlj_uri": malojauri,
|
||||
|
@ -8,7 +8,7 @@
|
||||
<script src="/datechange.js" async></script>
|
||||
{% endblock %}
|
||||
|
||||
{% set charts = dbc.get_charts_albums(filterkeys,limitkeys) %}
|
||||
{% set charts = dbc.get_charts_albums(filterkeys,limitkeys,{'only_own_albums':True}) %}
|
||||
{% set pages = math.ceil(charts.__len__() / amountkeys.perpage) %}
|
||||
{% if charts[0] is defined %}
|
||||
{% set topalbum = charts[0].album %}
|
||||
|
@ -48,7 +48,7 @@
|
||||
|
||||
<!-- SUBCERTS -->
|
||||
|
||||
{% set charts = db.get_charts_tracks(album=album.album,timerange=malojatime.alltime()) %}
|
||||
{% set charts = dbc.get_charts_tracks({'album':album.album,'timerange':malojatime.alltime()}) %}
|
||||
{% for e in charts -%}
|
||||
{%- if e.scrobbles >= settings.scrobbles_gold -%}{% set cert = 'gold' %}{%- endif -%}
|
||||
{%- if e.scrobbles >= settings.scrobbles_platinum -%}{% set cert = 'platinum' %}{%- endif -%}
|
||||
|
@ -2,7 +2,7 @@
|
||||
{% import 'snippets/entityrow.jinja' as entityrow %}
|
||||
|
||||
{% if charts is undefined %}
|
||||
{% set charts = dbc.get_charts_albums(filterkeys,limitkeys) %}
|
||||
{% set charts = dbc.get_charts_albums(filterkeys,limitkeys,{'only_own_albums':True}) %}
|
||||
{% endif %}
|
||||
{% if compare %}
|
||||
{% if compare is true %}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
{% if charts is undefined %}
|
||||
{% set charts = dbc.get_charts_albums(limitkeys) %}
|
||||
{% set charts = dbc.get_charts_albums(filterkeys,limitkeys,{'only_own_albums':True}) %}
|
||||
{% endif %}
|
||||
|
||||
{% set charts_14 = charts | fixlength(14) %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user