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