Fix(subsonic): missing default order for search3

prune_skipped_uploads_docs
Marcos Peña 2022-07-19 15:16:00 +00:00 zatwierdzone przez Georg Krause
rodzic 51788a324c
commit 209e118882
3 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -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):

Wyświetl plik

@ -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(

Wyświetl plik

@ -0,0 +1 @@
Fixed unpredictable subsonic search3 results (#1782)