-
Notifications
You must be signed in to change notification settings - Fork 823
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
Add Playlist Sort By Video Duration #5627
base: development
Are you sure you want to change the base?
Conversation
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
Odd. Now it is not displaying the toast message at all |
Head branch was pushed to by a user without write access
Alright that should fix the issue. |
Head branch was pushed to by a user without write access
Works fine so far except I think the notice should be shown also when changing sort order in single playlist view (unless already shown
(B)
|
Head branch was pushed to by a user without write access
7143e62 moves the call to when the playlist items are sorted, so if you load a playlist and then change the sorting, it'll still show. This means (A) and most of (B) are handled. I'm not terribly sure how to make it only fire once though. Thoughts? |
Head branch was pushed to by a user without write access
Alright, I've given single-firing only a shot, and also tweaked the time to be only 5 seconds, as 10 seemed a little long to me |
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
@absidue it still has to iterate through all the playlist items, but this way it'll only do it if it's needed and seems to fix all the issues raised. I'm not terribly sure how performant it is as of yet, as I'm not sure of a way to test large playlists. |
I think Out of scope for this PR anyway |
Also, it would probably be good to do the same for videos fetched via RSS, but yeah that's out of scope for this PR. |
Is there any functional reason for doing it with the subscriptions or just a nice to have? We previously never had a need to modify the entries because the duration was a purely visual thing, so overlaying it from the watch history was fine. It's only become a problem now that you are building functionality on top of it, which as far as I can tell has nothing to do with the subscriptions... The reason I'm asking is that if we do have to modify all the subscription cache entries, that would prevent us from switching the videos and live caches to |
If you add a video from the subscriptions page, and it has been fetched via RSS, it would be sorted with the value Basically, I foresee two approaches: update the metadata when watching the video, which would require checking each playlist every time you watch a video, or updating the metadata from history when interacting with a playlist. |
The main problem I have with having to update the durations in the playlist is that we'll have to do it every time a video is watched and there is no way to do it quickly, because it will require going through every single video in every single playlist every time and then also doing the database updates. And a large part of the reason it will be slow is because the playlists are currently deeply reactive and they will have to stay that way if we want to do those modifications to the individual playlist items. Although as long as we make sure that that doesn't impact the actual watch history updates, so doing it in a two step process, updating the watch history first and the metadata updates afterwards, it should be okay. |
…unction everywhere
Head branch was pushed to by a user without write access
…ation/use a foreach loop to check the videos in a playlist
Head branch was pushed to by a user without write access
As that's what I've got working now, that's all good with me. One thing I would suggest, is maybe a button that reloads the metadata for all videos in a playlist? That way you don't care how long it takes, as it's an action invoked by the user themselves. |
@Hoverth That might be misleading for the user as they might be expecting it to fetch everything from YouTube, when it would actually be updating based on the watch history. Fetching loads of data unnecessarily from YouTube is the last thing we would want to do. |
Weird idea and not sure if feasible but what about using the toast message for this purpose. Message would need to be slightly modified but if we add something like this to the toast |
@absidue That's fair enough. Is there any other issues with this PR? |
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.
Only method with side effects should be named after the action
Co-authored-by: PikachuEXE <git@pikachuexe.net>
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
Add Playlist Sort By Video Duration
Pull Request Type
Related issue
Closes: #5268
Description
Closes issue #5268 and PR #5423. It works off what @creotove put in their PR, but also includes a small notification if there is a video in the playlist that does not have a time attached to it.