See #432: genre listing/filtering in Subsonic

This commit is contained in:
Eliot Berriot 2019-07-19 08:19:36 +02:00
parent 904a482698
commit 692e175a6c
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
4 changed files with 102 additions and 4 deletions

View file

@ -263,3 +263,11 @@ class ScrobbleSerializer(serializers.Serializer):
return history_models.Listening.objects.create(
user=self.context["user"], track=data["id"]
)
def get_genre_data(tag):
return {
"songCount": getattr(tag, "_tracks_count", 0),
"albumCount": getattr(tag, "_albums_count", 0),
"value": tag.name,
}