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

Add rewatch feature to episode NextUp widget #275

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

bwachtendorf
Copy link

Adds support for SenorSmartyPants rewatch feature to the episode NextUp widget.
See jellyfin/jellyfin#7253 for server side implementation.

rewatch_days = int(settings.getSetting("rewatch_days"))
if rewatch_days > 0:
rewatch_since = datetime.datetime.today() - datetime.timedelta(days=rewatch_days)
url_params["nextUpDateCutoff"] = rewatch_since.strftime("%Y-%m-%d")
Copy link
Member

Choose a reason for hiding this comment

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

I haven't had a chance to test yet, but this changes the entirety of next up, not just the rewatching feature, no? That doesn't seem like an intentional change that should be included here

Copy link
Author

Choose a reason for hiding this comment

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

This would indeed change the complete behavior of next up, but it would be the same behavior as the current android client.
Additionally it would change it "only" if the rewatch feature is enabled in the addon settings.
The problem is, that without the date cutoff, the query returns a bunch of episodes that are not relevant (rewatch finished months ago or stopped).
I see two alternatives to the current implementation:

  1. Make it a new separate widget
  2. Make a second API call and combine data of next up with next up + rewatch and filter out duplicates

Copy link
Member

Choose a reason for hiding this comment

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

I don't have too much of an opinion, honestly. I personally don't see the need for the feature, and from what I saw after it was added it's pretty finnicky (or was, at least). I'll likely never use it myself.

Doing multiple api calls will slow the menu down quite a bit. There's the second network round trip of actually doing the request, then merging the data locally. It wouldn't surprise me if it comes down to anywhere from half a second to a full second slower. But it does eliminate the changing behavior of non-rewatching episodes not all being displayed.

Basically, ¯\_(ツ)_/¯. I would say implement it whichever way you think is best, and if it's problematic we can always adjust it later in a future release. As long as it's disabled by default (which it currently is).

@mcarlton00
Copy link
Member

This now has merge conflicts. You should only edit the english language files here, and then any other languages are translated through https://translate.jellyfin.org. Otherwise it will break the weblate integration and require manual intervention to fix

@bwachtendorf
Copy link
Author

I will do that. Any feedback on the alternative implementations I suggested? Personally I think the two query approach would be the best option.

@bwachtendorf
Copy link
Author

I added a toggle to switch between the original behavior and the two API call approach.
On my system it wasn't noticeably slower with two API calls, but I tested it only on my desktop in the same network as the server.

@bwachtendorf
Copy link
Author

I have been using my feature branch for two weeks now on my NVIDIA Shield and didn't encounter any bugs.
The only "problem" is, that the next episode will show up, when the previous episode was stopped and can be resumed.

@bwachtendorf
Copy link
Author

bwachtendorf commented Aug 26, 2023

@TrueTechy could you take a look at this? @mcarlton00 seems to have disappeared and I kind of forgot about this.
I have been using my feature branch for a few months now and didn't encounter any bugs except that one where two episodes of the same show up when one is in progress.

@mcarlton00 mcarlton00 added enhancement New feature or request minor Will trigger a minor release labels Dec 11, 2023
@mcarlton00 mcarlton00 merged commit e55af6c into jellyfin:master Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor Will trigger a minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants