12 Commits

Author SHA1 Message Date
42a76004d2 quickfix artist stats 2020-03-28 15:08:10 +01:00
51c04de639 artist stats fix 2020-03-28 15:04:42 +01:00
e287bae4fd Merge branch 'marietje-zuid' of gitlab.science.ru.nl:dsprenkels/MarietjeDjango into oslomp/artists 2020-03-28 14:21:55 +01:00
dd21a3c97d Fucking Pylint 2.0. 2020-03-28 13:26:43 +01:00
c65bdcabd8 Fucking Pylint. 2020-03-28 13:23:36 +01:00
716c159648 even more indentation fixes. 2020-03-28 13:15:42 +01:00
cec537d70e more indentation fixes. 2020-03-28 13:11:18 +01:00
078e45dbbe more textual fixes 2020-03-28 13:06:54 +01:00
f66e13883c textual fix 2020-03-28 13:02:48 +01:00
fbbc944e71 fixed indentation 2020-03-28 13:00:31 +01:00
a6cc389e0b mini fixes 2020-03-28 12:56:27 +01:00
8b437310ab Added artist-specific stats 2020-03-28 12:53:26 +01:00

View File

@ -109,8 +109,8 @@ def compute_stats():
stats['most_played_artists'] = PlaylistSong.objects.filter(state=2).exclude(
Q(user_id=None)
| Q(user_id__in=settings.STATS_REQUEST_IGNORE_USER_IDS)).values(
'song__artist__id', 'song__artist__name').annotate(total=Count('song__artist__id')).order_by(
'-total', 'song__artist__name')[:settings.STATS_TOP_COUNT]
'song__artist').annotate(total=Count('song__artist')).order_by(
'-total', 'song__artist')[:settings.STATS_TOP_COUNT]
stats['most_played_songs_14_days'] = PlaylistSong.objects.filter(
state=2, played_at__gte=timezone.now() -
@ -171,6 +171,7 @@ def compute_stats():
'unique_request_stats': list(stats['unique_request_stats']),
'total_unique_requests': "{0:,.0f}".format(stats['total_unique_requests']['total']),
'most_played_songs': list(stats['most_played_songs']),
'most_played_artists': list(stats['most_played_artists']),
'most_played_songs_14_days': list(stats['most_played_songs_14_days']),
'time_requested': stats['time_requested'],
'total_time_requested': str(round(float(