mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-09 18:22:24 +01:00
Compare commits
12 Commits
marietje-z
...
oslomp/art
| Author | SHA1 | Date | |
|---|---|---|---|
| 42a76004d2 | |||
| 51c04de639 | |||
| e287bae4fd | |||
| dd21a3c97d | |||
| c65bdcabd8 | |||
| 716c159648 | |||
| cec537d70e | |||
| 078e45dbbe | |||
| f66e13883c | |||
| fbbc944e71 | |||
| a6cc389e0b | |||
| 8b437310ab |
@ -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(
|
||||
|
||||
Reference in New Issue
Block a user