kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
Fix(subsonic): missing default order for search3
rodzic
51788a324c
commit
209e118882
|
@ -187,7 +187,7 @@ def order_for_search(qs, field):
|
|||
When searching, it's often more useful to have short results first,
|
||||
this function will order the given qs based on the length of the given field
|
||||
"""
|
||||
return qs.annotate(__size=models.functions.Length(field)).order_by("__size")
|
||||
return qs.annotate(__size=models.functions.Length(field)).order_by("__size", "pk")
|
||||
|
||||
|
||||
def recursive_getattr(obj, key, permissive=False):
|
||||
|
|
|
@ -566,7 +566,7 @@ class SubsonicViewSet(viewsets.GenericViewSet):
|
|||
except (TypeError, KeyError, ValueError):
|
||||
size = 20
|
||||
|
||||
size = min(size, 100)
|
||||
size = min(size, 500)
|
||||
queryset = c["queryset"]
|
||||
if query:
|
||||
queryset = c["queryset"].filter(
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Fixed unpredictable subsonic search3 results (#1782)
|
Ładowanie…
Reference in New Issue