mirror of
https://github.com/krateng/maloja.git
synced 2025-07-09 03:04:07 -04:00
Fix GH-341
This commit is contained in:
parent
33ed2abdea
commit
152e3948a1
@ -444,10 +444,11 @@ def get_charts_albums(dbconn=None,resolve_ids=True,only_own_albums=False,**keys)
|
|||||||
(since,to) = keys.get('timerange').timestamps()
|
(since,to) = keys.get('timerange').timestamps()
|
||||||
|
|
||||||
if 'artist' in 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)
|
artist = sqldb.get_artist(sqldb.get_artist_id(keys['artist']))
|
||||||
|
result = sqldb.count_scrobbles_by_album_combined(since=since,to=to,artist=artist,associated=keys.get('associated',False),resolve_ids=resolve_ids,dbconn=dbconn)
|
||||||
if only_own_albums:
|
if only_own_albums:
|
||||||
# TODO: this doesnt take associated into account and doesnt change ranks
|
# 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 [])]
|
result = [e for e in result if artist in (e['album']['artists'] or [])]
|
||||||
else:
|
else:
|
||||||
result = sqldb.count_scrobbles_by_album(since=since,to=to,resolve_ids=resolve_ids,dbconn=dbconn)
|
result = sqldb.count_scrobbles_by_album(since=since,to=to,resolve_ids=resolve_ids,dbconn=dbconn)
|
||||||
return result
|
return result
|
||||||
|
@ -29,6 +29,8 @@ def uri_to_internal(keys,accepted_entities=('artist','track','album'),forceTrack
|
|||||||
|
|
||||||
# 1
|
# 1
|
||||||
filterkeys = {}
|
filterkeys = {}
|
||||||
|
# this only takes care of the logic - what kind of entity we're dealing with
|
||||||
|
# it does not check with the database if it exists or what the canonical name is!!!
|
||||||
if "track" in accepted_entities and "title" in keys:
|
if "track" in accepted_entities and "title" in keys:
|
||||||
filterkeys.update({"track":{"artists":keys.getall("trackartist"),"title":keys.get("title")}})
|
filterkeys.update({"track":{"artists":keys.getall("trackartist"),"title":keys.get("title")}})
|
||||||
if "artist" in accepted_entities and "artist" in keys:
|
if "artist" in accepted_entities and "artist" in keys:
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
{% for entry in dbc.get_charts_albums(filterkeys,limitkeys,{'only_own_albums':False}) %}
|
{% for entry in dbc.get_charts_albums(filterkeys,limitkeys,{'only_own_albums':False}) %}
|
||||||
|
|
||||||
|
|
||||||
{% if artist not in (entry.album.artists or []) %}
|
{% if info.artist not in (entry.album.artists or []) %}
|
||||||
|
|
||||||
{%- set cert = None -%}
|
{%- set cert = None -%}
|
||||||
{%- if entry.scrobbles >= settings.scrobbles_gold_album -%}{% set cert = 'gold' %}{%- endif -%}
|
{%- if entry.scrobbles >= settings.scrobbles_gold_album -%}{% set cert = 'gold' %}{%- endif -%}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user