Repository navigation
Restrict duplicate video additions and implement DiffUtil to prevent list flickering and crashes during playlist pagination. - #13981
Closed
Ayush32-ai wants to merge 3 commits into
Closed
Ayush32-ai wants to merge 3 commits into
Ayush32-ai wants to merge 3 commits into
Conversation
Contributor
|
Please link this PR to an existing issue you are assigned to. This PR might be closed if the details of this PR were not agreed upon beforehand. |
Author
|
@TobiGr Please check the code and pull request. |
Author
|
@TobiGr suggestion regarding my pull request. |
|
Member
We need to enfore strict contibution guidelines to keep the workload manageble. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



What is it?
Description of the changes in your PR
This PR fixes duplicate videos being added to local playlists and improves how playlist items are updated.
PlaylistAppendDialog.javato prevent adding a video if it's already in the selected playlist. A Toast message is shown when the video is already there.cleanTimingFromUrl()inLocalPlaylistManager.ktto remove timestamp parameters from video URLs. This makes sure the same video is recognized even if it has a different start time, such as?t=30sor#t=1m.getPlaylistDuplicates()andappendToPlaylist()to check for duplicates before adding items to the database.LocalPlaylistManagerDuplicateTest.kt.PlaylistFragment.javaandLocalPlaylistFragment.javato use DiffUtil instead of refreshing the entire list whenever the data changes.InfoItemDiffCallback.ktandLocalItemDiffCallback.kt, along with tests forInfoItemDiffCallback.kt.InfoItemDiffCallback.ktusing occurrence-based indexing so identical URLs are matched correctly and don't cause incorrect moves or index-related crashes.Before/After Screenshots/Screen Record
Fixes the following issue(s)
Relies on the following changes
Testing/QA
Devices
Steps for testing
APK for testing
The debug APK is available under the Checks tab of the PR, in the CI artifacts.
Due diligence