diff --git a/marietje/stats/templates/stats/user.html b/marietje/stats/templates/stats/user.html
index d1bdcb3..5c99762 100644
--- a/marietje/stats/templates/stats/user.html
+++ b/marietje/stats/templates/stats/user.html
@@ -107,7 +107,32 @@
+
+
+
Biggest fans
+
The people that queued your songs the most are:
+
+
+
+
+ | # |
+ User |
+ # Requests |
+
+
+
+ {% for stat in stats.biggest_fans %}
+
+ | {{ forloop.counter }} |
+ {{ stat.user__name }} |
+ {{ stat.total }} |
+
+ {% endfor %}
+
+
+
+
{% endif %}
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/marietje/stats/utils.py b/marietje/stats/utils.py
index 61f26b1..fcfeb4a 100644
--- a/marietje/stats/utils.py
+++ b/marietje/stats/utils.py
@@ -203,6 +203,14 @@ def user_stats(request):
total=Count('song__user__id')).order_by(
'-total')[:settings.STATS_TOP_COUNT]
+ biggest_fans = PlaylistSong.objects.filter(
+ state=2, song_id__in=Song.objects.filter(user__id=request)).exclude(
+ Q(user_id=None)
+ | Q(user_id__in=settings.STATS_REQUEST_IGNORE_USER_IDS)).values(
+ 'user__id', 'user__name').annotate(
+ total=Count('user__id')).order_by(
+ '-total')[:settings.STATS_TOP_COUNT]
+
most_played_uploads = PlaylistSong.objects.filter(
state=2, song_id__in=Song.objects.filter(user__id=request)).exclude(
user__id=None).values('song__artist', 'song__title').annotate(
@@ -230,4 +238,5 @@ def user_stats(request):
'stats_top_count': settings.STATS_TOP_COUNT,
'total_played_uploads': total_played_uploads,
'total_played_user_uploads': total_played_user_uploads,
+ 'biggest_fans': list(biggest_fans),
}