Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix order of local search results #7491

Merged
merged 3 commits into from
Dec 14, 2021

Conversation

Stypox
Copy link
Member

@Stypox Stypox commented Dec 4, 2021

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

Results from the local database were being fetched from the database in the correct order, but then the DISTINCT part of the query was not done by SQL but by Java using a Set, which then caused all items to be ordered alphabetically and not by creation date. This PR fixes this by having the related queries just return a list of strings that are already the correct ones and in the correct order. I just added DISTINCT to the queries.

Fixes the following issue(s)

Fixes #7133

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.

Due diligence

@AudricV AudricV added the bug Issue is related to a bug label Dec 4, 2021
litetex
litetex previously approved these changes Dec 8, 2021
Copy link
Member

@litetex litetex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM;

Tested it - seems to work as expected.

👍 for the UnitTests

Copy link
Collaborator

@XiangRongLin XiangRongLin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked at the tests themselves.

Copy link
Collaborator

@XiangRongLin XiangRongLin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests look good 👍

Comment on lines +44 to +46
// For some reason the Flowable returned by getAll() never completes, so we can't assert
// that the number of Lists it returns is exactly 1, we can only check if the first List is
// correct. Why on earth has a Flowable been used instead of a Single for getAll()?!?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆

@XiangRongLin XiangRongLin merged commit dd9772c into TeamNewPipe:dev Dec 14, 2021
@Stypox Stypox deleted the fix-search-order branch December 14, 2021 16:37
@Stypox Stypox mentioned this pull request Jan 5, 2022
4 tasks
@Stypox Stypox mentioned this pull request Jan 24, 2022
5 tasks
This was referenced Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NewPipe v0.21.10 broke 'Search History' functionality
4 participants