Repository navigation
Fix IsPlayed and IsUnplayed sorting for shows and collections - #17713
Merged
Merged
Conversation
Ordering mapped both keys to the item's own stored UserData row. Folders do not have one: a series, season or box set counts as played when no descendant is left unplayed, which is what the isPlayed filter and the DTO both report. A mixed library therefore sorted every series and box set into the unplayed group, and a query could filter and sort by two different notions of "played". Extract the filter's predicate into BuildIsPlayedFilter and route both sort keys through it so the two cannot drift apart again.
|
LTe
marked this pull request as ready for review
August 25, 2026 13:45
Shadowghost
approved these changes
Aug 25, 2026
Contributor
Jellyfin API (v 12.0.0)ResultNo differences. Specifications are equivalent |
crobibero
approved these changes
Aug 25, 2026
8 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
The
IsPlayedandIsUnplayedsort options do not work for shows and collections. They stay in the unplayed group however much of them has been played, and flippingsortOrderreturns the very same list. Only movies sort correctly.Six shows,
Alpha ShowandFoxtrot Showfully played. Before:Passing
sortOrder=Descendingreturns that same list, unchanged, which is what gives the bug away. The key evaluates to the same value for every show, so there is nothing for the direction to reverse.After:
This is not a regression. Ordering has read the item's own stored played flag since at least 10.9, where both keys mapped to the same column, and #12798 carried that over to EF Core unchanged.
jellyfin/Emby.Server.Implementations/Data/SqliteItemRepository.cs
Lines 2860 to 2861 in 7bbdfc0
Filtering got its folder handling back then as a special case, with a note next to it.
jellyfin/Emby.Server.Implementations/Data/SqliteItemRepository.cs
Lines 3524 to 3525 in 7bbdfc0
Filtering has since been generalised to every folder kind. Ordering never was.
Note that no first party client offers these two as a sort option today, the web client exposes played state as a filter only.
Code assistance
Code was written with help of Claude Code.
Issues