Fix top chart view
This commit is contained in:
@ -98,32 +98,32 @@ class RecentScrobbleList(ListView):
|
|||||||
user=self.request.user,
|
user=self.request.user,
|
||||||
)
|
)
|
||||||
|
|
||||||
# limit = 14
|
limit = 14
|
||||||
# artist = {"user": user, "media_type": "Artist", "limit": limit}
|
artist = {"user": user, "media_type": "Artist", "limit": limit}
|
||||||
#This is weird. They don't display properly as QuerySets, so we cast to lists
|
#This is weird. They don't display properly as QuerySets, so we cast to lists
|
||||||
# data["chart_keys"] = {
|
data["chart_keys"] = {
|
||||||
# "today": "Today",
|
"today": "Today",
|
||||||
# "last7": "Last 7 days",
|
"last7": "Last 7 days",
|
||||||
# "last30": "Last 30 days",
|
"last30": "Last 30 days",
|
||||||
# "year": "This year",
|
"year": "This year",
|
||||||
# "all": "All time",
|
"all": "All time",
|
||||||
# }
|
}
|
||||||
# data["current_artist_charts"] = {
|
data["current_artist_charts"] = {
|
||||||
# "today": list(live_charts(**artist, chart_period="today")),
|
"today": list(live_charts(**artist, chart_period="today")),
|
||||||
# "last7": list(live_charts(**artist, chart_period="last7")),
|
"last7": list(live_charts(**artist, chart_period="last7")),
|
||||||
# "last30": list(live_charts(**artist, chart_period="last30")),
|
"last30": list(live_charts(**artist, chart_period="last30")),
|
||||||
# "year": list(live_charts(**artist, chart_period="year")),
|
"year": list(live_charts(**artist, chart_period="year")),
|
||||||
# "all": list(live_charts(**artist)),
|
"all": list(live_charts(**artist)),
|
||||||
# }
|
}
|
||||||
|
|
||||||
# track = {"user": user, "media_type": "Track", "limit": limit}
|
track = {"user": user, "media_type": "Track", "limit": limit}
|
||||||
# data["current_track_charts"] = {
|
data["current_track_charts"] = {
|
||||||
# "today": list(live_charts(**track, chart_period="today")),
|
"today": list(live_charts(**track, chart_period="today")),
|
||||||
# "last7": list(live_charts(**track, chart_period="last7")),
|
"last7": list(live_charts(**track, chart_period="last7")),
|
||||||
# "last30": list(live_charts(**track, chart_period="last30")),
|
"last30": list(live_charts(**track, chart_period="last30")),
|
||||||
# "year": list(live_charts(**track, chart_period="year")),
|
"year": list(live_charts(**track, chart_period="year")),
|
||||||
# "all": list(live_charts(**track)),
|
"all": list(live_charts(**track)),
|
||||||
# }
|
}
|
||||||
data["counts"] = scrobble_counts(user)
|
data["counts"] = scrobble_counts(user)
|
||||||
else:
|
else:
|
||||||
data["weekly_data"] = week_of_scrobbles()
|
data["weekly_data"] = week_of_scrobbles()
|
||||||
|
|||||||
@ -1,3 +1,6 @@
|
|||||||
|
{% load humanize %}
|
||||||
|
{% load naturalduration %}
|
||||||
|
<div>
|
||||||
<h2>Last Scrobbles</h2>
|
<h2>Last Scrobbles</h2>
|
||||||
<p>Today <b>{{counts.today}}</b> | This Week <b>{{counts.week}}</b> | This Month <b>{{counts.month}}</b> | This Year <b>{{counts.year}}</b> | All Time <b>{{counts.alltime}}</b></p>
|
<p>Today <b>{{counts.today}}</b> | This Week <b>{{counts.week}}</b> | This Month <b>{{counts.month}}</b> | This Year <b>{{counts.year}}</b> | All Time <b>{{counts.alltime}}</b></p>
|
||||||
</div>
|
</div>
|
||||||
@ -206,4 +209,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
</div>
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
{% load static %}
|
||||||
<h2>Top Artist</h2>
|
<h2>Top Artist</h2>
|
||||||
<ul class="nav nav-tabs" id="artistTab" role="tablist">
|
<ul class="nav nav-tabs" id="artistTab" role="tablist">
|
||||||
{% for key, name in chart_keys.items %}
|
{% for key, name in chart_keys.items %}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load humanize %}
|
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
{% load humanize %}
|
||||||
{% load naturalduration %}
|
{% load naturalduration %}
|
||||||
|
|
||||||
{% block head_extra %}
|
{% block head_extra %}
|
||||||
@ -85,7 +85,6 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% include "scrobbles/_top_charts.html" %}
|
{% include "scrobbles/_top_charts.html" %}
|
||||||
@ -94,6 +93,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
{% include "scrobbles/_last_scrobbles.html" %}
|
{% include "scrobbles/_last_scrobbles.html" %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<div class="modal fade" id="importModal" tabindex="-1" role="dialog" aria-labelledby="importModalLabel"
|
<div class="modal fade" id="importModal" tabindex="-1" role="dialog" aria-labelledby="importModalLabel"
|
||||||
|
|||||||
Reference in New Issue
Block a user