Some cleanup

This commit is contained in:
krateng 2023-10-28 02:01:26 +02:00
parent ad9cad9e94
commit 56030acf0e
6 changed files with 5 additions and 6 deletions

View File

@ -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:

View File

@ -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,

View File

@ -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 %}

View File

@ -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 -%}

View File

@ -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 %}

View File

@ -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) %}