mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 22:38:26 +02:00
Fixed really slow SQL
This commit is contained in:
parent
8b0ce6ad33
commit
1295144681
6 changed files with 19 additions and 12 deletions
|
@ -101,7 +101,7 @@ class ArtistAlbumSerializer(serializers.Serializer):
|
|||
return o.artist_id
|
||||
|
||||
def get_tracks_count(self, o):
|
||||
return o._tracks_count
|
||||
return len(o.tracks.all())
|
||||
|
||||
def get_is_playable(self, obj):
|
||||
try:
|
||||
|
@ -210,7 +210,7 @@ class AlbumSerializer(OptionalDescriptionMixin, serializers.Serializer):
|
|||
return serialize_artist_simple(o.artist)
|
||||
|
||||
def get_tracks_count(self, o):
|
||||
return getattr(o, "_tracks_count", None)
|
||||
return len(o.tracks.all())
|
||||
|
||||
def get_is_playable(self, obj):
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue