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