TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
31.19k stars 3.03k forks source link

Sort entries in bookmarked playlist #9497

Open ein-bandit opened 1 year ago

ein-bandit commented 1 year ago

Checklist

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

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

Jared234 commented 1 year ago

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:

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?

SameenAhnaf commented 1 year ago

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?

opusforlife2 commented 1 year ago

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

Jared234 commented 1 year ago

@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?

opusforlife2 commented 1 year ago

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 commented 1 year ago

@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. 😉

Jared234 commented 1 year ago

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

ein-bandit commented 1 year ago

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

ChaosNicro commented 1 year ago

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?

ein-bandit commented 1 year ago

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.

juliloving commented 1 year ago

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

sosasees commented 1 month ago

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"