Commit 4ac4e93f authored by Agate's avatar Agate 💬

Merge branch 'denormalization-issue' into 'develop'

Fixed empty results issue when browsing library with playable filter

See merge request !1065
parents 24405505 e4b989f5
Pipeline #10065 passed with stages
in 9 minutes and 20 seconds
......@@ -58,7 +58,8 @@ class LibraryFilterSet(filters.FilterSet):
uploads = models.Upload.objects.filter(library=library)
uploads = uploads.playable_by(actor)
ids = uploads.values_list(self.Meta.library_filter_field, flat=True)
return queryset.filter(pk__in=ids)
qs = queryset.filter(pk__in=ids).distinct()
return qs
class ArtistFilter(
......@@ -88,7 +89,7 @@ class ArtistFilter(
def filter_playable(self, queryset, name, value):
actor = utils.get_actor_from_request(self.request)
return queryset.playable_by(actor, value)
return queryset.playable_by(actor, value).distinct()
class TrackFilter(
......@@ -127,7 +128,7 @@ class TrackFilter(
def filter_playable(self, queryset, name, value):
actor = utils.get_actor_from_request(self.request)
return queryset.playable_by(actor, value)
return queryset.playable_by(actor, value).distinct()
class UploadFilter(audio_filters.IncludeChannelsFilterSet):
......
......@@ -105,13 +105,11 @@
</router-link>
</div>
<div class="ui hidden divider"></div>
<keep-alive>
<router-view
@updated="fetchData"
@uploads-finished="object.uploads_count += $event"
:is-owner="isOwner"
:object="object"></router-view>
</keep-alive>
</div>
</div>
</div>
......
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