mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 11:19:15 +02:00
Include only local content in nodeinfo stats, added downloads count
This commit is contained in:
parent
8d59d8f27a
commit
f146c0ae91
5 changed files with 16 additions and 6 deletions
|
@ -17,6 +17,7 @@ def get():
|
|||
"artists": get_artists(),
|
||||
"track_favorites": get_track_favorites(),
|
||||
"listenings": get_listenings(),
|
||||
"downloads": get_downloads(),
|
||||
"music_duration": get_music_duration(),
|
||||
}
|
||||
|
||||
|
@ -43,15 +44,19 @@ def get_track_favorites():
|
|||
|
||||
|
||||
def get_tracks():
|
||||
return models.Track.objects.count()
|
||||
return models.Track.objects.local().count()
|
||||
|
||||
|
||||
def get_albums():
|
||||
return models.Album.objects.count()
|
||||
return models.Album.objects.local().count()
|
||||
|
||||
|
||||
def get_artists():
|
||||
return models.Artist.objects.count()
|
||||
return models.Artist.objects.local().count()
|
||||
|
||||
|
||||
def get_downloads():
|
||||
return models.Track.objects.aggregate(d=Sum("downloads_count"))["d"] or 0
|
||||
|
||||
|
||||
def get_music_duration():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue