Skip to content

Resolve "Subsonic search3 not returning all songs"

Closes #1782 (closed)

Removes order_for_search (api/funkwhale_api/common/ from the queryset since it was ordering by a non unique order and might be the cause of the unpredictable results. Now it's ordered by the pk. According to the docs:

When using LIMIT, it is important to use an ORDER BY clause that constrains the result rows into a unique order. Otherwise you will get an unpredictable subset of the query's rows. You might be asking for the tenth through twentieth rows, but tenth through twentieth in what ordering? The ordering is unknown, unless you specified ORDER BY.

(Maybe we should rethink that function, it's also used in api/funkwhale_api/music/ This could be easily fixed by making the sort key unique by adding the primary key to it.).

As requested, this MR also increases the result limit to 500, in coherence with get_album_list2 by the way.

Merge request reports