<feed xmlns='http://www.w3.org/2005/Atom'>
<title>jellyfin/Emby.Server.Implementations/Sorting, branch v12.0-rc4</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://git.b0n.dev/jellyfin/atom?h=v12.0-rc4</id>
<link rel='self' href='https://git.b0n.dev/jellyfin/atom?h=v12.0-rc4'/>
<link rel='alternate' type='text/html' href='https://git.b0n.dev/jellyfin/'/>
<updated>2026-07-25T16:52:51Z</updated>
<entry>
<title>Merge pull request #17399 from Shadowghost/fix-extra-year</title>
<updated>2026-07-25T16:52:51Z</updated>
<author>
<name>Cody Robibero</name>
<email>cody@robibe.ro</email>
</author>
<published>2026-07-25T16:52:51Z</published>
<link rel='alternate' type='text/html' href='https://git.b0n.dev/jellyfin/commit/?id=7f26bd109171041f9e27a51f7cd3969fb2e8546d'/>
<id>urn:sha1:7f26bd109171041f9e27a51f7cd3969fb2e8546d</id>
<content type='text'>
Fix incorrect year on local trailers</content>
</entry>
<entry>
<title>Prefer null checks over HasValue everywhere</title>
<updated>2026-07-22T06:09:33Z</updated>
<author>
<name>Shadowghost</name>
<email>Ghost_of_Stone@web.de</email>
</author>
<published>2026-07-22T06:09:33Z</published>
<link rel='alternate' type='text/html' href='https://git.b0n.dev/jellyfin/commit/?id=6382563440b69d816639abc2b4d03fca1d35eca2'/>
<id>urn:sha1:6382563440b69d816639abc2b4d03fca1d35eca2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix: avoid NRE when sorting by user-dependent keys without a user</title>
<updated>2026-07-22T05:43:58Z</updated>
<author>
<name>Paolo Antinori</name>
<email>pantinor@redhat.com</email>
</author>
<published>2026-07-21T06:20:40Z</published>
<link rel='alternate' type='text/html' href='https://git.b0n.dev/jellyfin/commit/?id=5d580abb08d9d23f54e74050fdaa8fcdbc21571f'/>
<id>urn:sha1:5d580abb08d9d23f54e74050fdaa8fcdbc21571f</id>
<content type='text'>
A query sorted by a user-dependent key (PlayCount, IsFavoriteOrLiked,
DatePlayed, IsPlayed, IsUnplayed) but carrying no User caused a
NullReferenceException inside UserDataManager.GetUserData, surfacing as
"Failed to compare two elements in the array" (InvalidOperationException
wrapping the NRE from the LINQ sort) and 500-ing the /Items request.

Root cause: LibraryManager.GetComparer assigned comparer.User = user
without a null guard, so PlayCountComparer.GetValue called
UserDataManager.GetUserData(null, item), dereferencing user.Id.

Two-part fix:
- LibraryManager.GetComparer: when user is null and the sort key requires a
  user (IUserBaseItemComparer), substitute the SortName comparer so the
  result stays deterministic instead of 500-ing. SortName is the project's
  canonical tiebreaker (ItemsController injects it for album-by-artist).
- UserDataManager.GetUserData: ArgumentNullException.ThrowIfNull(user) as
  defense in depth (matches the existing guards on the SaveUserData
  overloads in the same file). On master this overload was rewritten to use
  ResolveUserDataRow, so the NRE dereferences user.Id rather than
  user.InternalId as on the release branch — same bug, different line.

Also fixes DateLastMediaAddedComparer being statically mis-tagged as
IUserBaseItemComparer: its GetDate is static and never reads User, so it
does not need one. Without this, the SortName fallback above would wrongly
engage for DateLastContentAdded on anonymous queries (returning SortName
order instead of date order). Re-tagged to IBaseItemComparer and dropped the
unused User/UserManager/UserDataManager properties.

Tests:
- UserDataManagerTests.GetUserData_NullUser_ThrowsArgumentNullException:
  reproduces the crash (NRE -&gt; now ArgumentNullException). Added to master's
  existing UserDataManagerTests.
- LibraryManagerSortTests.Sort_UserDependentKey_NullUser_FallsBackToSortNameWithoutThrowing:
  Sort with a user-dependent key + null user no longer throws and returns
  items ordered by the SortName fallback (direction preserved).
- LibraryManagerSortTests.Sort_DateLastContentAdded_NullUser_OrdersByDateNotSortName:
  guards that DateLastContentAdded still sorts by date with no user (fixture
  chosen so date-desc and SortName-desc disagree, so a revert is caught).

Full Jellyfin.Server.Implementations.Tests suite: 642 passed, 0 failed.

Fixes #17393
</content>
</entry>
<entry>
<title>Respect library country code for parental ratings</title>
<updated>2026-03-10T23:04:02Z</updated>
<author>
<name>theguymadmax</name>
<email>theguymadmax@proton.me</email>
</author>
<published>2026-03-10T23:04:02Z</published>
<link rel='alternate' type='text/html' href='https://git.b0n.dev/jellyfin/commit/?id=119b2e3d2ff275401870edb66ffcbb4569a9c678'/>
<id>urn:sha1:119b2e3d2ff275401870edb66ffcbb4569a9c678</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Replace AlphanumericComparator with new CompareOptions.NumericOrdering</title>
<updated>2026-01-14T17:55:47Z</updated>
<author>
<name>Bond_009</name>
<email>bond.009@outlook.com</email>
</author>
<published>2025-11-16T18:31:45Z</published>
<link rel='alternate' type='text/html' href='https://git.b0n.dev/jellyfin/commit/?id=098e8c6fed6aa1fd873f255b09b58e4780c087d6'/>
<id>urn:sha1:098e8c6fed6aa1fd873f255b09b58e4780c087d6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Revert IsPlayed optimization, pass UserItemData to IsPlayed when available (#14786)</title>
<updated>2025-09-14T17:18:21Z</updated>
<author>
<name>Cody Robibero</name>
<email>cody@robibe.ro</email>
</author>
<published>2025-09-14T17:18:21Z</published>
<link rel='alternate' type='text/html' href='https://git.b0n.dev/jellyfin/commit/?id=4d36bd635d3dd0ff5652c1807dce7a1a1dff8873'/>
<id>urn:sha1:4d36bd635d3dd0ff5652c1807dce7a1a1dff8873</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix modification checks and make sure to use UTC (#14347)</title>
<updated>2025-06-26T23:50:37Z</updated>
<author>
<name>Tim Eisele</name>
<email>Ghost_of_Stone@web.de</email>
</author>
<published>2025-06-26T23:50:37Z</published>
<link rel='alternate' type='text/html' href='https://git.b0n.dev/jellyfin/commit/?id=c6e568692ee14e66e6c844dc1e5481d705a096da'/>
<id>urn:sha1:c6e568692ee14e66e6c844dc1e5481d705a096da</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Cleanup external item data cleanup (#14072)</title>
<updated>2025-05-09T14:35:29Z</updated>
<author>
<name>Tim Eisele</name>
<email>Ghost_of_Stone@web.de</email>
</author>
<published>2025-05-09T14:35:29Z</published>
<link rel='alternate' type='text/html' href='https://git.b0n.dev/jellyfin/commit/?id=49c6a99e00d5bef49c4154a5a9500f39b84cc32e'/>
<id>urn:sha1:49c6a99e00d5bef49c4154a5a9500f39b84cc32e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rework parental ratings (#12615)</title>
<updated>2025-03-31T03:51:54Z</updated>
<author>
<name>Tim Eisele</name>
<email>Ghost_of_Stone@web.de</email>
</author>
<published>2025-03-31T03:51:54Z</published>
<link rel='alternate' type='text/html' href='https://git.b0n.dev/jellyfin/commit/?id=3fc3b04daf929d1d3a9533fc410cb77885eb2e8a'/>
<id>urn:sha1:3fc3b04daf929d1d3a9533fc410cb77885eb2e8a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fixed namespaces</title>
<updated>2025-03-25T15:45:00Z</updated>
<author>
<name>JPVenson</name>
<email>github@jpb.email</email>
</author>
<published>2025-03-25T15:45:00Z</published>
<link rel='alternate' type='text/html' href='https://git.b0n.dev/jellyfin/commit/?id=42bdb22bfb690a6af37d70f12844881d884927b1'/>
<id>urn:sha1:42bdb22bfb690a6af37d70f12844881d884927b1</id>
<content type='text'>
</content>
</entry>
</feed>
