Small fixes in stats and userstats, changed Most_played_uploads to exclude your own plays

This commit is contained in:
oslomp
2018-12-15 01:42:52 +01:00
parent ce73e5d874
commit aff8ddf878
2 changed files with 17 additions and 11 deletions

View File

@ -8,17 +8,22 @@
<h1>User Statistics</h1>
<div class="row">
{% if not stats %}
<div class="alert alert-danger">
<strong>Stats unavailable :(</strong>
</div>
{% else %}
{% if current_age_text %}
<div class="alert alert-info">
<strong>{{ current_age_text }}</strong>
{% endif %}
</div>
</div>
<h4>Total uploads: {{ stats.total_uploads }}</h4>
<h4>Total requests: {{ stats.total_requests }}</h4>
<h4>Unique requests: {{ stats.unique_requests }} ({% widthratio stats.unique_requests stats.total_requests 100 %}%)</h4>
<h4>Total requested uploads: {{stats.total_played_uploads}}</h4>
<div class="col-md-6">
<h2>Most played songs</h2>
<h4>Total: {{ stats.total_requests }}</h4>
<h4>Top {{ stats.stats_top_count }}:</h4>
<div class="table-responsive">
<table class="table table-striped">
@ -45,7 +50,8 @@
</div>
<div class="row">
<div class="col-md-6">
<h2>Most played uploads</h2>
<h2>Uploads requested by others</h2>
<h4>Total: {{stats.total_played_uploads}}</h4>
<h4>Top {{ stats.stats_top_count }}:</h4>
<div class="table-responsive">
<table class="table table-striped">
@ -87,7 +93,7 @@
<tr>
<th>{{ forloop.counter }}</th>
<td>{{ stat.song__user__name }}</td>
<td>{{ stat.total }} ({% widthratio stat.total total_requests 100 %}%)</td>
<td>{{ stat.total }} ({% widthratio stat.total stats.total_requests 100 %}%)</td>
</tr>
{% endfor %}
</tbody>
@ -95,5 +101,6 @@
</div>
</div>
</div>
{% endif %}
</div>
{% endblock %}