Queue home videos from the same folder#5573
Conversation
|
Thank you for your contribution. Unfortunately we won't be accepting it as it violates our LLM/"AI" Development Policy. |
| totalRecordCount = response.totalRecordCount | ||
| if (response.items.isEmpty()) break | ||
| videos += response.items | ||
| } while (videos.size < totalRecordCount) |
There was a problem hiding this comment.
Our current playback code does not allow for pagination so I can understand why this loop was added, however this will be problematic for large folders (lets say hundreds to thousands of videos in one folder) as it will cause a lot of fetching here.
We should only request a single page here and (for now) live with the fact that we have no paginated queues yet. I think the best way to do that is to use "nameStartsWithOrGreater" with the sortname of the requested video, as there doesn't seem to be any better filters for this in our API.
There was a problem hiding this comment.
Okay, I changed it to be the way you proposed. Usually should not be more than 150 item and in worst case can start with last item for next 150, if I got it right. In any case it would be nice to have a pagination here.
| val siblingVideos = getVideosInFolder(parentId) | ||
| if (siblingVideos.any { it.id == mainItem.id } && siblingVideos.size > 1) { |
There was a problem hiding this comment.
We should assume here that queuing the folder contains the requested item
There was a problem hiding this comment.
Yes, the requested item should normally be included in that single page. But I would still keep this, as I can think of those corner cases:
if the selected item is filtered out for any reason, launching the returned page would start from a different video;
if sortName is missing in the DTO and we fall back to name, which may not match the server-normalized sort name;
duplicate/equivalent sort names can affect ordering around the selected item
If you think those cases should be ignored, then I can remove this.
afe5625 to
c74410a
Compare
Changes
When playing a standalone home video item, load sibling videos from the same parent folder and start playback at the selected item. This lets home videos in the same folder play as a queue instead of only playing the selected video.
Code assistance
No code assistance, all natural.