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

fix: playback of series with large set of episodes #5786

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

maybeanerd
Copy link

@maybeanerd maybeanerd commented Jul 14, 2024

Changes

Fetch episode info for a single episode instead of all episodes when attemtping to start playing an episode.

Updated changes: #5786 (comment)

Issues

Fixes #5779

@maybeanerd maybeanerd requested a review from a team as a code owner July 14, 2024 19:46
@maybeanerd
Copy link
Author

maybeanerd commented Jul 14, 2024

I tested all behavior I could think of to see if this change broke anything - did not find any issues.
But I would prefer somebody with deeper knowledge of the system to check if this breaks anything? Seems like an awfully simple change that could change a lot of behavior.

@maybeanerd maybeanerd force-pushed the fix/playback-of-series-with-large-set-of-episodes branch 2 times, most recently from 73afdac to 71c4b6a Compare July 14, 2024 19:57
@dmitrylyzo
Copy link
Contributor

AFAIK, that way you can't switch to the next episode from the player and you have to start each episode manually or start playing the entire show or season.

@maybeanerd
Copy link
Author

Oh that's a good point.
I'll try testing that behavior later.

@maybeanerd
Copy link
Author

You were right, it broke that.
So, the solution might be an inbetween, using some kind of pagination to not get all, but just the previous and next episode in addition to the current one? This would ofc also need to update when changing episode

I will look a bit into how this could be done, but again, if somebody has more knowledge and relevant info to share, please do so!

@thornbill thornbill marked this pull request as draft July 27, 2024 00:27
@thornbill
Copy link
Member

Marking as a draft until a working solution is found.

-  fetch episode info for a single episode instead of all episodes in existence
@maybeanerd maybeanerd force-pushed the fix/playback-of-series-with-large-set-of-episodes branch from 71c4b6a to 8ce187b Compare November 12, 2024 20:56
@jellyfin-bot
Copy link
Collaborator

jellyfin-bot commented Nov 12, 2024

Cloudflare Pages deployment

Latest commit 3645095
Status ✅ Deployed!
Preview URL https://eae8bd59.jellyfin-web.pages.dev
Type 🔀 Preview

View build logs

Copy link

sonarcloud bot commented Nov 12, 2024

@maybeanerd
Copy link
Author

maybeanerd commented Nov 12, 2024

Hey! I just rewrote the solution to stop breaking skipping in the player. It does still have some limitations, but IMO it's a good enough solution without adding a new pagination to the player and API itself, which seems like a very large undertaking.

The current solution:

  1. limits the episodes when starting to play from an episode directly: to the current season. this means the player will not be able to skip to previous or next seasons, and will also exit when the season is finished. IMO this is not a bad tradeoff for the payloads to stay within reasonable sizes. This is the same behavior as it already was when starting to play a specific season

  2. does not change the behavior when playing a specific season. the response was already limited to that season.

  3. limits the episodes when starting to play from the general series overview: to the 100 first episodes. This means that the player will not be able to continue playing, or skip to, the 101st episode (no matter how many seasons). IMO this is something that will not happen when starting to play a series from the very start, so it's a good enough tradeoff.

@maybeanerd maybeanerd marked this pull request as ready for review November 12, 2024 22:20
@maybeanerd
Copy link
Author

maybeanerd commented Nov 12, 2024

I also looked into using limit for the "play an episode" request, but I was not able to correctly set the offset. The API (to my knowledge) supports the startItemId , but this would limit going back inside the player, as it would be missing previous episodes.
I also tried using startIndex, and e.g. subtracting limit/2 from it, but this does not work if you e.g. only have season 2 in your library. The episode index of the first episode in season2 could be 100, which would end up providing an offset that skips the entirety of season2 (because season1 doesn't exist on the server at all)

Therefore limiting to the currently selected season seemed like the best approach to me.
If you have any other/better approaches, please do let me know

@maybeanerd
Copy link
Author

@dmitrylyzo
ping because I don't know if you'll get notified about this PR update automatically
Not trying to stress you, just wanted to make sure it ends up in your inbox 👍

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.

TV series become unwatchable when they have too many episodes
4 participants