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

[Feature Request] Add the ability to remove duplicates in a playlist #1473

Closed
CatKasha opened this issue Jun 11, 2018 · 12 comments · Fixed by #9707
Closed

[Feature Request] Add the ability to remove duplicates in a playlist #1473

CatKasha opened this issue Jun 11, 2018 · 12 comments · Fixed by #9707
Labels
feature request Issue is related to a feature in the app playlist Anything to do with playlists in the app

Comments

@CatKasha
Copy link

I think it would be a useful feature for those who use their own playlists

@stale
Copy link

stale bot commented Dec 1, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 1, 2018
@TobiGr TobiGr removed the stale label Jul 19, 2019
@Stypox Stypox added the feature request Issue is related to a feature in the app label Aug 27, 2019
@illustribe
Copy link

+1 for this one!

@ChiefMikeK
Copy link

Already has been implemented

  1. Open the play list then long press on the duplicate item.
  2. press Delete
    :neckbeard:
    NewPipe-PL

@illustribe
Copy link

And do this one by one? On a +300 videos list??
Maybe the requested feature isn't well explained, or I'm on the wrong thread...
There should - or would be great to - be an option to either disallow adding twice the same video to a list, or to batch remove all duplicates.
Cheers and thanks you anyway :)

@CatKasha
Copy link
Author

@illustribe this is exactly what i wanted to answer to ChiefMikeK 😃
and way to implement this feature too!

@opusforlife2
Copy link
Collaborator

Closing in favour of #4186.

@SameenAhnaf SameenAhnaf reopened this Dec 30, 2022
@SameenAhnaf SameenAhnaf added the playlist Anything to do with playlists in the app label Dec 30, 2022
@Jared234
Copy link
Contributor

Jared234 commented Jan 8, 2023

I can start working on this.
However, before I start the implementation, I have a question regarding the deletion process.
IMO there are 2 ways you can delete duplicates:

  1. You get all streams of a playlist (with duplicates already removed) via a database query. After clearing the database completely, you simply re-add those streams.
  2. The other option is to find the duplicates and remove them in the same query. However, after that we would have to rebuild the corresponding index.

I think that the first approach is the most efficient way to handle the deletion of streams from the playlist. Currently, when we delete streams from the playlist (Remove Watched or Delete), we only make local changes to the itemListAdapter. Before exiting the playlist view, these changes are then persisted using the saveImmediate function in the LocalPlaylistFragment. This means that we only need to update the database once, rather than after each individual modification.

However, I am open to suggestions. Do you have an opinion on which approach I should choose?

@tsilvs
Copy link

tsilvs commented Jan 8, 2023

Do you have an opinion on which approach I should choose?

@Jared234 which option will work faster on playlists that could contain ~100 videos w/ ~4 of them being duplicates of one video and ~3 - of the other?

@Jared234
Copy link
Contributor

Jared234 commented Jan 9, 2023

Unfortunately, I am not quite sure which one would be the most performant or best overall method for deleting duplicates. That is also the reason why I initially created the comment. However, at least from the user's perspective, I believe that option 1 will most likely be faster.
Are there any other developers who want to share their opinion on this?

@SameenAhnaf
Copy link
Collaborator

SameenAhnaf commented Jan 17, 2023

What about long press on any playlist for bulk selection? Selecting only greyed out playlist will show all three icons Remove, Deduplicate and +New Entry. If any of the selected playlists was not greyed out, only +New Entry would have been shown.

IMG_20230118_015747

IMG_20230118_020242

@Jared234
Copy link
Contributor

I agree that bulk selection could be a great feature. However, I don't think it fits within the scope of this issue, as it wouldn't be a small addition to it, but a complete change to the user interface.

@opusforlife2
Copy link
Collaborator

opusforlife2 commented Jan 19, 2023

We could always decide that we want to fulfill this FR via bulk selection (in combo with your duplicates warning PR), in which case this would remain open until someone implements that.

Personally, that is also the solution I would go for. Now that users are warned about duplicates, there will be no more unintentional duplicates. Having a button just to remove them will become too overly specific a feature for later releases.

Edit: actually, once the sorting-filtering framework is added, most sorts would group duplicates together. Or there could even be a 'duplicates' filter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issue is related to a feature in the app playlist Anything to do with playlists in the app
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants