mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Minor stuff
This commit is contained in:
parent
eb9cd4aba4
commit
b50afe70ea
@ -251,10 +251,10 @@ def artist_info(artist):
|
||||
except:
|
||||
# if the artist isnt in the charts, they are not being credited and we
|
||||
# need to show information about the credited one
|
||||
artist = sqldb.get_credited_artists(artist)[0]
|
||||
c = [e for e in alltimecharts if e["artist"] == artist][0]
|
||||
replaceartist = sqldb.get_credited_artists(artist)[0]
|
||||
c = [e for e in alltimecharts if e["artist"] == replaceartist][0]
|
||||
position = c["rank"]
|
||||
return {"replace":artist,"scrobbles":scrobbles,"position":position}
|
||||
return {"artist":artist,"replace":replaceartist,"scrobbles":scrobbles,"position":position}
|
||||
|
||||
|
||||
|
||||
|
@ -377,7 +377,9 @@ def count_scrobbles_by_artist(since,to):
|
||||
).select_from(jointable2).where(
|
||||
DB['scrobbles'].c.timestamp<=to,
|
||||
DB['scrobbles'].c.timestamp>=since
|
||||
).group_by(sql.func.coalesce(DB['associated_artists'].c.target_artist,DB['trackartists'].c.artist_id)).order_by(sql.desc('count'))
|
||||
).group_by(
|
||||
sql.func.coalesce(DB['associated_artists'].c.target_artist,DB['trackartists'].c.artist_id)
|
||||
).order_by(sql.desc('count'))
|
||||
result = conn.execute(op).all()
|
||||
|
||||
|
||||
|
@ -35,6 +35,7 @@ def update_jinja_environment():
|
||||
# external
|
||||
"urllib": urllib,
|
||||
"math":math,
|
||||
"print":print, # TODO: remove this
|
||||
# config
|
||||
"ranges": [
|
||||
('day','7 days',malojatime.today().next(-6),'day',7),
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% extends "abstracts/base.jinja" %}
|
||||
{% block title %}Maloja - {{ artist }}{% endblock %}
|
||||
{% block title %}Maloja - {{ info.artist }}{% endblock %}
|
||||
|
||||
{% import 'snippets/links.jinja' as links %}
|
||||
{% import 'partials/awards_artist.jinja' as awards %}
|
||||
@ -47,7 +47,7 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text">
|
||||
<h1 class="headerwithextra">{{ artist }}</h1>
|
||||
<h1 class="headerwithextra">{{ info.artist }}</h1>
|
||||
{% if competes %}<span class="rank"><a href="/charts_artists?max=100">#{{ info.position }}</a></span>{% endif %}
|
||||
<br/>
|
||||
{% if competes and included %}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% extends "abstracts/base.jinja" %}
|
||||
{% block title %}Maloja - {{ track.title }}{% endblock %}
|
||||
{% block title %}Maloja - {{ info.track.title }}{% endblock %}
|
||||
|
||||
{% import 'snippets/links.jinja' as links %}
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
</td>
|
||||
<td class="text">
|
||||
<span>{{ links.links(track.artists) }}</span><br/>
|
||||
<h1 class="headerwithextra">{{ track.title }}</h1>
|
||||
<h1 class="headerwithextra">{{ info.track.title }}</h1>
|
||||
{{ awards.certs(track) }}
|
||||
<span class="rank"><a href="/charts_tracks?max=100">#{{ info.position }}</a></span>
|
||||
<br/>
|
||||
|
Loading…
Reference in New Issue
Block a user