mirror of
https://github.com/krateng/maloja.git
synced 2025-04-16 16:52:18 +03:00
The things I do for performance
This commit is contained in:
parent
c0de2e6cd3
commit
936f4094eb
@ -605,7 +605,10 @@ def artist_info(dbconn=None,**keys):
|
||||
|
||||
cert = None
|
||||
own_track_charts = get_charts_tracks(timerange=alltime(),resolve_ids=False,artist=artist,dbconn=dbconn)
|
||||
own_album_charts = get_charts_albums(timerange=alltime(),resolve_ids=False,artist=artist,dbconn=dbconn)
|
||||
own_album_charts = get_charts_albums(timerange=alltime(),resolve_ids=True,artist=artist,dbconn=dbconn)
|
||||
# we resolve ids here which we don't need to. however, on the jinja page we make that same call
|
||||
# later again with resolve ids, so its a cache miss and it doubles page load time
|
||||
# TODO: find better solution
|
||||
if own_track_charts:
|
||||
c = own_track_charts[0]
|
||||
scrobbles = c["scrobbles"]
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div id="showcase_container">
|
||||
|
||||
|
||||
{% for entry in dbc.get_charts_albums(filterkeys,limitkeys,{'appearing':False}) %}
|
||||
{% for entry in dbc.get_charts_albums(filterkeys,limitkeys) %}
|
||||
|
||||
{%- set cert = None -%}
|
||||
{%- if entry.scrobbles >= settings.scrobbles_gold_album -%}{% set cert = 'gold' %}{%- endif -%}
|
||||
|
@ -57,7 +57,8 @@
|
||||
<!-- SUBCERTS -->
|
||||
|
||||
|
||||
{% set albumcharts = dbc.get_charts_albums({'artist':artist,'timerange':malojatime.alltime()}) %}
|
||||
{% set albumcharts = dbc.get_charts_albums({'artist':artist,'timerange':malojatime.alltime(),'resolve_ids':True}) %}
|
||||
{# TODO: find better solution, we just resolve ids here because we have that in the cache anyway #}
|
||||
{% for e in albumcharts -%}
|
||||
{%- if e.scrobbles >= settings.scrobbles_gold_album -%}{% set cert = 'gold' %}{%- endif -%}
|
||||
{%- if e.scrobbles >= settings.scrobbles_platinum_album -%}{% set cert = 'platinum' %}{%- endif -%}
|
||||
|
Loading…
x
Reference in New Issue
Block a user