Skip to content

Fix series merging leaking across libraries and under-counting merged children - #17693

Merged
crobibero merged 4 commits into
jellyfin:masterfrom
Shadowghost:fix-series-merging
Aug 23, 2026
Merged

crobibero merged 4 commits into
jellyfin:masterfrom
Shadowghost:fix-series-merging

Conversation

@Shadowghost

Copy link
Copy Markdown
Contributor

Regression from #17417

Series.PresentationUniqueKey no longer carries the owning library, but the queries that resolve a merged series' children are not library-scoped: LibraryManager.AddUserToQuery deliberately skips TopParentIds when SeriesPresentationUniqueKey or AncestorWithPresentationUniqueKey is set. I missed this when I changed the behavior.

Separately, played/total counts for a merged series are taken from the grouping survivor's own subtree, meaning they were wrong too.

Changes

  • Restore the owning-library suffix on Series.PresentationUniqueKey, now sorted with StringComparer.Ordinal so sibling folder-items cannot diverge on enumeration order
  • Expand played/total counts over the whole presentation-key group
  • Count distinct child keys in GetChildCountBatch for merged folders
  • Add DescendantQueryHelper.GetAllDescendantIdsBatch so a group's descendants resolve in one traversal
  • Rename RecomputeSeriesPresentationKey to a new date prefix and correct it in place to fix existing data
  • Add tests for this use case

Code assistance
Claude Opus 5 for testing

Issues
Fixes #17692

@jellyfin-bot

Copy link
Copy Markdown
Contributor

Jellyfin API (v 12.0.0)


Result


No differences. Specifications are equivalent

@crobibero crobibero moved this from Todo to Review in Jellyfin v12 Aug 21, 2026
@theguymadmax theguymadmax moved this from Review to Approved in Jellyfin v12 Aug 22, 2026
@sonarqubecloud

Copy link
Copy Markdown

@crobibero
crobibero merged commit af8e19b into jellyfin:master Aug 23, 2026
19 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in Jellyfin v12 Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Seasons merging across libraries instead of within libraries

4 participants