Fix sorting search result by health #5880
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a problem when folders are not displayed in the channel content view after sorting by "health".
The essence of the fix is in replacing INNER JOIN to LEFT JOIN in SQL query, so ChannelNode objects without TorrentState corresponding objects are still returned by the query.
Also, in this PR I add default ordering by
rowid
to all queries which return ChannelNode objects, to have guaranteed stable sorting order in tests.Some tests are marked with FIXME as they are not returning totally correct results. Namely, full-text search queries don't return more than one folder. This is a separate bug in full-text search queries and will be fixed in a separate PR.