mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-03 23:39:16 +02:00
Blacked the code
This commit is contained in:
parent
b6fc0051fa
commit
62ca3bd736
279 changed files with 8861 additions and 9527 deletions
|
@ -8,13 +8,13 @@ from funkwhale_api.users.models import User
|
|||
|
||||
def get():
|
||||
return {
|
||||
'users': get_users(),
|
||||
'tracks': get_tracks(),
|
||||
'albums': get_albums(),
|
||||
'artists': get_artists(),
|
||||
'track_favorites': get_track_favorites(),
|
||||
'listenings': get_listenings(),
|
||||
'music_duration': get_music_duration(),
|
||||
"users": get_users(),
|
||||
"tracks": get_tracks(),
|
||||
"albums": get_albums(),
|
||||
"artists": get_artists(),
|
||||
"track_favorites": get_track_favorites(),
|
||||
"listenings": get_listenings(),
|
||||
"music_duration": get_music_duration(),
|
||||
}
|
||||
|
||||
|
||||
|
@ -43,9 +43,7 @@ def get_artists():
|
|||
|
||||
|
||||
def get_music_duration():
|
||||
seconds = models.TrackFile.objects.aggregate(
|
||||
d=Sum('duration'),
|
||||
)['d']
|
||||
seconds = models.TrackFile.objects.aggregate(d=Sum("duration"))["d"]
|
||||
if seconds:
|
||||
return seconds / 3600
|
||||
return 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue