-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Remove duplicates from playlist feature #9707
Remove duplicates from playlist feature #9707
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
app/src/main/java/org/schabi/newpipe/database/playlist/dao/PlaylistStreamDAO.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/database/playlist/dao/PlaylistStreamDAO.java
Outdated
Show resolved
Hide resolved
Thanks for the review. I have implemented all your suggestions. |
final List<PlaylistStreamEntry> itemsToKeep = playlistManager | ||
.getDistinctPlaylistStreams(playlistId).blockingFirst(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this run in a separate thread, just like removeWatchedStreams
? Also, while duplicates are being removed, the loading screen should be shown.
You could rename isRemovingWatched
to isRewritingPlaylist
and use it to prevent concurrent calls to removeDuplicates and removeWatched. Unfortunately this has never been the best solution (since there are other functions that change the playlist that are not guarded by that boolean, and so you might still get concurrent changes to the playlist), but there's no need to rework state handling in this PR (a viewmodel would be needed), so keep it as it was before.
…list' into 1473_remove_duplicates_from_playlist
See this sonar warning: https://sonarcloud.io/project/issues?resolved=false&types=CODE_SMELL&pullRequest=9707&id=TeamNewPipe_NewPipe&open=AYXO4S5J5QjBB_bdSBLT I think you can use our own R.string.ok (or R.string.yes). Same goes for cancel iirc. |
app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java
Outdated
Show resolved
Hide resolved
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I tested it a bit, even with my database, and everything seems to work fine. Thanks! Sorry for the repeated comments, I had to make changes from my phone. I hope I have merged this in time, and good luck again with the exam ;-)
Yes, all my projects are now finished by the deadline. Thank you very much for all the support. I really enjoyed working on NewPipe. |
What is it?
Description of the changes in your PR
Before/After Screenshots/Screen Record
Fixes the following issue(s)
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