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

Sort entries in bookmarked playlist #9497

Open
6 tasks done
ein-bandit opened this issue Dec 3, 2022 · 11 comments
Open
6 tasks done

Sort entries in bookmarked playlist #9497

ein-bandit opened this issue Dec 3, 2022 · 11 comments
Labels
feature request Issue is related to a feature in the app playlist Anything to do with playlists in the app

Comments

@ein-bandit
Copy link

Checklist

  • I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • I have read the FAQ and my problem isn't listed.
  • 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.
  • I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise.
  • This issue contains only one feature request.
  • 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

@ein-bandit ein-bandit added feature request Issue is related to a feature in the app needs triage Issue is not yet ready for PR authors to take up labels Dec 3, 2022
@SameenAhnaf SameenAhnaf added playlist Anything to do with playlists in the app and removed needs triage Issue is not yet ready for PR authors to take up labels Dec 4, 2022
@Jared234
Copy link
Contributor

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?

@SameenAhnaf
Copy link
Collaborator

show unwatched first

#8473 is intended to seperate watched and unwatched videos in feed. Is this sort option still required?

@opusforlife2
Copy link
Collaborator

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

@Jared234
Copy link
Contributor

@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
Copy link
Collaborator

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
Copy link
Collaborator

@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
Copy link
Contributor

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

@ein-bandit
Copy link
Author

ein-bandit commented Jan 26, 2023

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
Copy link

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
Copy link
Author

ein-bandit commented Jan 29, 2023

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
Copy link

juliloving commented Feb 5, 2023

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

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

No branches or pull requests

6 participants