mirror of
https://github.com/krateng/maloja.git
synced 2025-04-12 07:00:02 +03:00
Fixed album charts
This commit is contained in:
parent
f6f1db6eac
commit
7d709ef6d9
@ -436,6 +436,7 @@ def get_charts_albums(dbconn=None,resolve_ids=True,only_own_albums=False,**keys)
|
||||
if 'artist' in keys:
|
||||
result = sqldb.count_scrobbles_by_album_combined(since=since,to=to,artist=keys['artist'],associated=keys.get('associated',False),resolve_ids=resolve_ids,dbconn=dbconn)
|
||||
if only_own_albums:
|
||||
# TODO: this doesnt take associated into account and doesnt change ranks
|
||||
result = [e for e in result if keys['artist'] in (e['album']['artists'] or [])]
|
||||
else:
|
||||
result = sqldb.count_scrobbles_by_album(since=since,to=to,resolve_ids=resolve_ids,dbconn=dbconn)
|
||||
|
@ -8,7 +8,7 @@
|
||||
<script src="/datechange.js" async></script>
|
||||
{% endblock %}
|
||||
|
||||
{% set charts = dbc.get_charts_albums(filterkeys,limitkeys,{'only_own_albums':True}) %}
|
||||
{% set charts = dbc.get_charts_albums(filterkeys,limitkeys,{'only_own_albums':False}) %}
|
||||
{% set pages = math.ceil(charts.__len__() / amountkeys.perpage) %}
|
||||
{% if charts[0] is defined %}
|
||||
{% set topalbum = charts[0].album %}
|
||||
|
@ -2,7 +2,7 @@
|
||||
{% import 'snippets/entityrow.jinja' as entityrow %}
|
||||
|
||||
{% if charts is undefined %}
|
||||
{% set charts = dbc.get_charts_albums(filterkeys,limitkeys,{'only_own_albums':True}) %}
|
||||
{% set charts = dbc.get_charts_albums(filterkeys,limitkeys,{'only_own_albums':False}) %}
|
||||
{% endif %}
|
||||
{% if compare %}
|
||||
{% if compare is true %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user