Repository navigation
Fix (Un)Played filter correctness and performance - #17463
Conversation
Jellyfin API (v 12.0.0)ResultNo differences. Specifications are equivalent |
|
Confirming this fixes the bug for me. I'm the reporter on #17284 — here's what I did to verify. Original repro: My workflow is download episode → watch → mark played → delete the file via the Jellyfin client (not out-of-band on disk). After doing this repeatedly, ~95% of my TV library ended up as series with zero remaining episode files, still showing a "played" badge, but persisting in Filters=IsUnplayed results. Confirmed via API on 12.0-rc3 before this fix: GET /Users/{userId}/Items/{seriesId} but the same series was still returned by: GET /Users/{userId}/Items?ParentId={library}&IncludeItemTypes=Series&Recursive=true&Filters=IsUnplayed — exactly the DTO-vs-SQL-filter disagreement on the empty-children case described in this PR. Verification: Built pr-17463 on top of master against a clean throwaway instance (isolated datadir, own port, no shared state with my production server). Reproduced the same scenario from scratch — watched and deleted an episode, leaving a series with zero remaining episodes — and the Unplayed filter now correctly excludes it. Matches the fix description exactly. Thanks for turning this around so fast. |
1821073 to
eed664b
Compare
|
@Shadowghost filtered by clicking a tag and now applying a filter is still broken. If I filter for played, some played shows are missing and also other way around. |
crobibero
left a comment
There was a problem hiding this comment.
Technically an ABI break, but no plugins use it so I think it is fine
|
|
Fixes #16826 as well - nice - works |
Changes
A folder's played state was computed two different ways that disagreed on the empty case:
Folder.IsPlayedtreat a folder with no countable children as playedA series whose episodes have all been deleted therefore rendered with a played checkmark and
UnplayedItemCount: 0while simultaneously being returned by the Unplayed filter and excluded from the Played one.All three filter paths now match on absence of an unplayed descendant instead, so filter results and displayed state can no longer diverge.
Perf stats for a warm sample on 240k episodes:
Code assistance
Used Claude Code and Opus 5 for creating the Benchmarks and extract the query shapes.
Issues
Fixes #17284
Fixes #16826