-
-
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
Handle duplicate streams in the "Add to playlist" dialog #9538
Handle duplicate streams in the "Add to playlist" dialog #9538
Conversation
I was wondering if it would be possible to rerun the pipeline. All of the tests work locally, and in this pipeline the operation was cancelled without any error messages. I don't think there is a problem with the code, so could you please rerun it @AudricV? Thank you for your help. |
I don't think the AlertDialog is needed? Since the user has been warned that the item will be duplicated, and there is a visual indication as well, the dialog seems overkill. Also, for users who intentionally want to add duplicates, this would be an annoying extra step each and every time they go through with it. Instead of an AlertDialog, I would rather go with a toast saying "Duplicate added", which also informs the user that they did indeed go ahead and add a duplicate, but doesn't need a tap for confirmation. For users who ignore/don't read the warning about the greyed out playlists, the toast would act as a second warning. |
I see your point. The only downside to removing this dialog would be that users would not know how many duplicate videos are already in the playlist. At first glance, though, I don't know why anyone would need that information.... So I will change it. |
I removed the duplicate dialog and if a video was already at least once in the playlist I replaced the toast message "Playlisted" with "Playlisted duplicate". |
"Duplicate added There you go, if needed. |
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 agree with @opusforlife2 on the fact that a dialog is not needed and a toast is better. Let me know if the changes I requested for the list view are comprehensible.
app/src/main/java/org/schabi/newpipe/local/dialog/PlaylistAppendDialog.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/local/dialog/PlaylistAppendDialog.java
Outdated
Show resolved
Hide resolved
61a9c79
to
ef4a623
Compare
app/src/main/java/org/schabi/newpipe/local/LocalItemListAdapter.java
Outdated
Show resolved
Hide resolved
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.
I pushed two more small commits and tested thoroughly. It seems to work well. Thank you!
Kudos, SonarCloud Quality Gate passed! |
What is it?
Description of the changes in your PR
This helps prevent users from accidentally adding the same stream multiple times to their playlist, but stills allows them do it if they intend to do so.
Before/After Screenshots/Screen Record
If a user attempts to add a stream to a playlist twice, the playlist will be grayed out to indicate that it is a duplicate:
If a user attempts to add a stream to their playlist that is already in the playlist anyway, a dialog will appear to alert them that the stream is a duplicate and ask them if they want to proceed with adding it to the playlist:
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