NewPipe icon indicating copy to clipboard operation
NewPipe copied to clipboard

Sort entries in bookmarked playlist

Open kryptografisch opened this issue 2 years ago • 15 comments
trafficstars

Checklist

  • [X] I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • [X] I have read the FAQ and my problem isn't listed.
  • [X] I'm aware that this is a request for NewPipe itself and that requests for adding a new service need to be made at NewPipeExtractor.
  • [X] I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise.
  • [X] This issue contains only one feature request.
  • [X] I have read and understood the contribution guidelines.

Feature description

Clicking on a "bookmarked playlist" opens a list-view of all videos. Currently adding a new video appends it to the back (no sorting possible).

Add an option for sorting the entries of the list. This could be added in 3-dot-menu on the top right as "Sorting" entry.

Clicking "Sorting" 3-dot-menu-entry could open a modal with radio buttons to select a sorting style

  • time when new video was added to playlist (if available)
  • reverse by added-time (if availavble)
  • chronological alphabetical
  • reverse chronological alphabetical
  • show watched or partially watched first
  • show unwatched first

option 1 and 2 would solve my issue already, but when on it could be easily extended with more options.

Why do you want this feature?

I do use a custom playlist where I add videos to 'watch later'. Since my list contains a lot of videos by now (200+ entries) I would need a way to organize better. When I add a new video it gets appended at the end of the list. I do have to scroll down a lot to see newly added videos.

Additional information

old feature request without template #9202

kryptografisch avatar Dec 03 '22 20:12 kryptografisch

I can work on this. However, I still have some questions regarding the implementation.

AFAIK there is currently no option to sort feeds within NewPipe, right? If that's the case I believe that I should implement this feature keeping in mind that we can potentially also use it for other lists of streams in NewPipe. This would be my approach:

  • I would create an enum that contains all of the possible sorting options.
  • Then I would add a field to the PlaylistEntity that stores the respective sorting options.
  • I would adjust the getOrderedStreamsOf(playlistId) method in the PlaylistStreamDAO interface, so that it returns the streams in the right order for the respective playlist.

As for sorting options that let you sort streams by the time you added them to the playlist: I could definitely implement that. However, this information is not currently stored in the database and I'm not sure if this would bloat the database too much.

@opusforlife2 Do you have an opinion on all of this?

Jared234 avatar Jan 14 '23 16:01 Jared234

show unwatched first

https://github.com/TeamNewPipe/NewPipe/issues/8473 is intended to seperate watched and unwatched videos in feed. Is this sort option still required?

SameenAhnaf avatar Jan 16 '23 21:01 SameenAhnaf

@Jared234 Make sure you look at #8837 first, to prevent any duplicate effort. Maybe you could help push that PR along?

opusforlife2 avatar Jan 19 '23 03:01 opusforlife2

@SameenAhnaf I agree that this sorting option is not needed. Even without the existing theme, IMO this would be more of a filter option than a sort option. @opusforlife2 I took a closer look at this PR and also tried it myself. I don't think we're trying to do the same thing. This PR focuses on extending the functionality of the search feature by providing "sort filters (and content filters) that are available by the supported platforms itself". For the bookmarked playlists, I would do something more like this (screenshot of the equivalent of YouTube): image

Do you have an opinion on this comment?

Jared234 avatar Jan 20 '23 09:01 Jared234

I can't comment on the coding aspect of this because I'm not qualified. But I get your point about:

"sort filters (and content filters) that are available by the supported platforms itself"

so I guess that will have to be done from scratch for local, non-service-based sorting and filtering. Have I understood this correctly?

Let me just confirm this with the devs once, since I assume this will need a major PR.

opusforlife2 avatar Jan 20 '23 14:01 opusforlife2

@Jared234 Thanks for offering to implement this, but could you hold off on such a big feature for now? The team is already juggling several huge PRs and we'd like things to settle down some more before taking on additional work.

Keep the bugfixes coming, though. 😉

opusforlife2 avatar Jan 21 '23 03:01 opusforlife2

@opusforlife2 Yes, no problem. I'm definitely going to do that. 😄

Jared234 avatar Jan 21 '23 09:01 Jared234

i'm not 100% sure how the bookmarked playlists are implemented now, but i assume the videos in the playlist are stored locally. so i assume it could be a "sorting for the locally loaded videos" function? we are talking about the same thing, are we?

i can help giving feedback on PR

kryptografisch avatar Jan 26 '23 23:01 kryptografisch

That also had me confused. We have bookmarked online playlists that mirror a playlist on youtube but these are read-only. I think this is about saved playlists, the kind stored locally and read-write. I don't think they store an "added datetime" per video at the moment but just a flat order. While you could add that tag for new additions and save a setting per playlist to insert new videos at the right position to retain the sorting, a one-time sorting might be easier. That would basically be a button that parses through all entries once by a given video property and saves the result as a flat order. That combined with a per-playlist switch to insert new videos at the first position instead of the last might already accomplish what you are asking for, right?

ChaosNicro avatar Jan 28 '23 14:01 ChaosNicro

custom created playlist it is, yes. an option for adding to front/back would be nice yes, could also be implicit based on the current sorting (no user choice necessary) - so "last sorting action" would need to be stored. e.g. sorting by "newest entry" would also make a new video be added to front (index 0). I think you can see the video list as an array and "just assign a single videos a different index in the array". would fulfill the minimal requirements, yes.

kryptografisch avatar Jan 29 '23 11:01 kryptografisch

As someone with a huge playlist on NewPipe who scrolls far to find the latest videos added, a "sort by" would be very helpful! I've wanted this for a while, thanks for bringing this up. There should be a toggle button at the top that's an arrow to switch between last added and first added as well

juliloving avatar Feb 05 '23 22:02 juliloving

each video in a playlist would need "date added" only to view when a video was added. just to sort by date added, an "added index" is enough: just make the added index of each newly added video 1 higher than the current highest added index in the playlist.

although grouping the videos by date added (like pictures in the Gallery app) could be useful, so for that we would need "date added" rather than just "added index"

sosasees avatar Aug 24 '24 19:08 sosasees

Good to see this feature request.

Just to add to this: it may be useful to save the sort order for each playlist. Some playlists might have numbered videos that you want to sort (and keep sorted) that way, whereas another playlist might be used as a 'watch later' playlist which perhaps you always want to view in most recently added first order.

snuggles4553 avatar Nov 24 '24 22:11 snuggles4553

may be useful to save the sort order for each playlist

If this is implemented, it should definitely be paired with a 'Reset' button that lets the playlist go back to the default sort option, rather than forcing the user to remember what it was. I can imagine the tedium of having to remember which other playlist has the default sort order, figuring out what that order actually is, and then going back to the first playlist in order to set it.

opusforlife2 avatar Nov 24 '24 22:11 opusforlife2

@opusforlife2 That's a valid point. Maybe the UI for setting the playlist's sort order could be in the little kebab menu, so you can either view or set the sort order there. And it could include a 'Default' option to reset it to the default sort order.

snuggles4553 avatar Nov 24 '24 22:11 snuggles4553

Please implement custom sorting of playlists in the playlist overview and the video sequence within a playlist. Thank you

gl-dev avatar Sep 04 '25 18:09 gl-dev