Verified Commit 2b70f3ba authored by Agate's avatar Agate 💬

Fix #581: missing track count on various library cards

parent a6264d7d
Pipeline #2281 passed with stages
in 5 minutes and 22 seconds
......@@ -35,7 +35,7 @@ def get_libraries(filter_uploads):
uploads = uploads.playable_by(actor)
libraries = models.Library.objects.filter(
pk__in=uploads.values_list("library", flat=True)
)
).annotate(_uploads_count=Count("uploads"))
libraries = libraries.select_related("actor")
page = self.paginate_queryset(libraries)
if page is not None:
......
......@@ -462,6 +462,7 @@ def test_can_get_libraries_for_music_entities(
import_status="finished", library__privacy_level="me", track=upload.track
).library
library = upload.library
setattr(library, "_uploads_count", 1)
data = {
"artist": upload.track.artist,
"album": upload.track.album,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment