diff --git a/api/funkwhale_api/music/views.py b/api/funkwhale_api/music/views.py
index 871dfc920fc052e9e05a85b30c66796ba629a1c2..c8d1b94fc39a9b0c98f559b2d0b098c35515cd09 100644
--- a/api/funkwhale_api/music/views.py
+++ b/api/funkwhale_api/music/views.py
@@ -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:
diff --git a/api/tests/music/test_views.py b/api/tests/music/test_views.py
index 2f9d66e5b00d81fb56871e344df4df456ebf6a67..389306820268157cc2e3d40a08bcc980edd4625d 100644
--- a/api/tests/music/test_views.py
+++ b/api/tests/music/test_views.py
@@ -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,
diff --git a/changes/changelog.d/581.bugfix b/changes/changelog.d/581.bugfix
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391