| Age | Commit message (Collapse) | Author |
|
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 -> 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
|
|
Fix: Fetch the correct row matching the most up to date file
|
|
|
|
preloaded
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Removes unused private GetUserData and GetUserDataInternal methods.
Moves GetUserDataBatch to be an abstract interface method rather than
having a default implementation for clarity.
|
|
|
|
|
|
|
|
* Implement basic expiring cache for LibraryManager
* Add expiring cache to more places
* Rider why
* Make DirectoryService caches static
* Use FastConcurrentLru
* Reduce default cache size
* Simplify DirectoryService caches
* Make directory service cache size at least 128
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fixed UserDataKey not stored
|
|
|
|
|
|
|
|
Refactored BaseItem and UserData relation
|
|
|
|
* enable nullable
* remove unused methods
* fix warnings and docs
|
|
|
|
|
|
|
|
|
|
Did a simple search/replace on the whole repo (except the RSSDP project)
This reduces LOC and should improve performance (methods containing a throw statement don't get inlined)
```
if \((\w+) == null\)
\s+\{
\s+throw new ArgumentNullException\((.*)\);
\s+\}
```
```
ArgumentNullException.ThrowIfNull($1);
```
|
|
|
|
|
|
|
|
Fixes for Book Progress
|
|
|
|
- Refactored check if item is not audio book or book to be more readable
|
|
- Ignore Books when checking for minium progress
|
|
|
|
https://github.com/jellyfin/jellyfin/issues/5703
|
|
|
|
Co-authored-by: Bond-009 <bond.009@outlook.com>
|
|
Co-authored-by: Bond-009 <bond.009@outlook.com>
|
|
Co-authored-by: Bond-009 <bond.009@outlook.com>
|