Skip to content

fix: honor Jellyfin played threshold#2466

Merged
ydkmlt84 merged 2 commits into
mainfrom
fix/jellyfin-played-threshold-2465
Mar 9, 2026
Merged

fix: honor Jellyfin played threshold#2466
ydkmlt84 merged 2 commits into
mainfrom
fix/jellyfin-played-threshold-2465

Conversation

@enoch85

@enoch85 enoch85 commented Mar 8, 2026

Copy link
Copy Markdown
Collaborator

What:
Use Jellyfin's own played threshold when building watch history instead of relying only on the Played flag.

Why:
This makes the Jellyfin "Viewed by" behavior match Jellyfin's configured watched semantics.

Fixes #2465

Note:
Not fully tested. This is a POC.

@enoch85

enoch85 commented Mar 8, 2026

Copy link
Copy Markdown
Collaborator Author

Maybe related?

#2453

@ydkmlt84

ydkmlt84 commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

I tested this out and the code changes look good too. Nice way to use manually marked items in a view count rule. I am going to merge this as well as the Plex equivalent. Will be nice additions!!

@ydkmlt84 ydkmlt84 merged commit 5f24c7d into main Mar 9, 2026
12 checks passed
@ydkmlt84 ydkmlt84 deleted the fix/jellyfin-played-threshold-2465 branch March 9, 2026 07:25
@ydkmlt84

ydkmlt84 commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

I did merge this into the main branch, but it is worth noting that the Plex side has an issue. Well, two issues.

The data that is being used in that change is cached for 5 minutes. Would not be/could not be a problem unless you are trying to run rules or test media shortly after marking something as watched.

The fix is to use the PlexMetadata pulled at the top of the getter, which is already called and has per item cache updates. It currently does not have viewCount as a returned item. Adding it isn't a solution either as that call, and its results, are per the user token who pulled the metadata (whoever is authenticated in Maintainerr and usually admin).

So viewCount for the admin user might be 1 and another user looking at viewCount would see 2 (only there two watches). Maintainerr only sees 1 instead of 3. So that isn't a viable option either when you have multiple users and want viewcount for the entire server, across all users.

I do not have multiple Jellyfin users so I couldn't test this on their side.

enoch85 added a commit that referenced this pull request Mar 9, 2026
…, #2442, #2406, #2386, #2370

PR #2466 - fix: honor Jellyfin played threshold
- Respect configured played percentage threshold for Jellyfin watch status

PR #2461 - feat(rules): add ARR disk target path selection for disk space rules
- Allow selecting specific disk target paths for Radarr/Sonarr disk space rules

PR #2458 - feat: clean up empty ended shows in Sonarr after season actions
- Automatically remove ended shows from Sonarr when all seasons are processed

PR #2453 - fix: improve Plex viewCount reliability and add isWatched boolean
- Use native Plex viewCount field with watch history fallback
- Add new isWatched boolean rule property

PR #2452 - build(deps): bump actions/download-artifact from 7 to 8

PR #2451 - build(deps): bump actions/upload-artifact from 6 to 7

PR #2442 - fix(server): reject null/undefined in numeric rule comparisons
- Add getComparisonResult wrapper that fails closed on null/undefined operands
- Strict type checking for BIGGER/SMALLER comparisons

PR #2406 - Metadata provider abstraction layer with TVDB support
- Add MetadataService as central metadata resolution layer
- TVDB support as alternative metadata provider
- Dynamic provider preference with fallback
- Replace TmdbIdService with unified MetadataService

PR #2386 - feat: missing_episode rules
- Add missing episode count as a rule property for Sonarr

PR #2370 - build(deps-dev): bump the eslint group with 2 updates

enoch85 commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator Author

This is now included in the jellyfin-dev docker container - among some other fixes. To upgrade, change tag in docker from latest (or whatever you have) to jellyfin-dev. Then do:

docker compose pull jellyfin-dev && docker compose up -d

You can check the latest commits here: https://github.com/Maintainerr/Maintainerr/commits/jellyfin-dev

  1. Consider the jellyfin-dev branch to be early development, and make a backup before switching to that branch!
  2. Please test that your issue is fixed
  3. Report back here, and tag me and @ydkmlt84

Thank you very much! 🚀

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jellyfin - [list] Viewed by (username) getting not completed for movies

2 participants