Skip to content

Queue home videos from the same folder#5573

Open
Scorpeg wants to merge 2 commits into
jellyfin:masterfrom
Scorpeg:feature/home-video-folder-queue
Open

Queue home videos from the same folder#5573
Scorpeg wants to merge 2 commits into
jellyfin:masterfrom
Scorpeg:feature/home-video-folder-queue

Conversation

@Scorpeg

@Scorpeg Scorpeg commented May 4, 2026

Copy link
Copy Markdown

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.

@nielsvanvelzen

Copy link
Copy Markdown
Member

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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +238 to +239
val siblingVideos = getVideosInFolder(parentId)
if (siblingVideos.any { it.id == mainItem.id } && siblingVideos.size > 1) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should assume here that queuing the folder contains the requested item

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Scorpeg Scorpeg force-pushed the feature/home-video-folder-queue branch from afe5625 to c74410a Compare June 2, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants