Repository navigation
Stop user updates from orphaning permission and preference rows - #17645
Merged
Merged
Conversation
Contributor
Jellyfin API (v 12.0.0)ResultNo differences. Specifications are equivalent |
JPVenson
approved these changes
Aug 15, 2026
IDisposable
approved these changes
Aug 16, 2026
cvium
requested changes
Aug 16, 2026
cvium
left a comment
Member
There was a problem hiding this comment.
Why are we making alternatives to a 2 day old PR (a first-time contributor as well) instead of reviewing the first one?
cvium
reviewed
Aug 16, 2026
Co-authored-by: Claus Vium <cvium@users.noreply.github.com>
cvium
approved these changes
Aug 16, 2026
Member
|
@Shadowghost remember to update the PR description (without Claude if possible). |
Contributor
|
This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged. |
# Conflicts: # Jellyfin.Server.Implementations/Users/UserManager.cs
|
Bond-009
approved these changes
Aug 20, 2026
thcuba
added a commit
to thcuba/haos-jellyfin
that referenced
this pull request
Aug 24, 2026
* Translated using Weblate (Faroese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/fo/ * Translated using Weblate (Faroese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/fo/ * Translated using Weblate (Faroese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/fo/ * Switch to opt-in * Translated using Weblate (Dutch) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/nl/ * Translated using Weblate (Dutch) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/nl/ * Translated using Weblate (Catalan) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/ca/ * Translated using Weblate (Dutch) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/nl/ * Translated using Weblate (Chinese (Simplified Han script)) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/zh_Hans/ * Translated using Weblate (German) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/de/ * Translated using Weblate (Spanish (Argentina)) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/es_AR/ * Translated using Weblate (Spanish (Mexico)) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/es_MX/ * Translated using Weblate (Spanish (Latin America)) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/es_419/ * Fix disabled plugins being re-enabled on restart * Only treat series and seasons as resumable folders * Keep folder extras with the item that owns the folder * Clear metadata provider cache when provider parts are registered AddParts replaces _metadataProviders but left _metadataProviderCache holding provider arrays from the previous registration. Invalidate the cache so repeated AddParts calls cannot serve stale providers, and give the previously uncalled ClearMetadataProviderCache its intended caller. * Fix test * Translated using Weblate (Arabic) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/ar/ * Translated using Weblate (French (Canada)) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/fr_CA/ * Translated using Weblate (French) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/fr/ * Translated using Weblate (Italian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/it/ * Translated using Weblate (Slovak) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/sk/ * Translated using Weblate (Faroese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/fo/ * Degrade ForceKeepAlive logs to debug * Fix /Persons favourites timing out by removing the correlated favourites join * Translated using Weblate (Lithuanian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/lt/ * Translated using Weblate (Swedish) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/sv/ * Translated using Weblate (Ukrainian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/uk/ * Translated using Weblate (Faroese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/fo/ * Translated using Weblate (Italian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/it/ * Translated using Weblate (Korean) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/ko/ * Translated using Weblate (Icelandic) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/is/ * Fix concurrent ffmpeg segment racing This is a nasty one. The failure mode is: 1. Request A started FFmpeg and waited for a segment. 2. Request B requested an earlier or far away segment. 3. Jellyfin thought FFmpeg should to restart at a different position. 4. Request B killed the existing transcoding job. 5. Killing that job cancelled the same token request A was using. 6. The cancellation produced http 500 to request A. To fix this: we lock transcoding job state changes and segment handling per playlist, and use a thread safe counter to track how many http responses are still using each job’s segments. A job is only stopped or replaced once that counter reaches zero. * Update github/codeql-action action to v4.37.6 * Fix PCM audio transcoding to wav returning HTTP 500 and headerless output `GetProgressiveAudioFullCommandLine` forced the raw PCM muxer and a bogus sample rate whenever the audio encoder was `pcm_*`, regardless of the container the client asked for. Two separate failures came out of it: - `-ar ` + `state.BaseRequest.AudioBitRate` used a *bitrate* as a *sample rate*, and `AudioBitRate` is optional. When it is absent the argument degrades to a bare `-ar`, ffmpeg aborts with `Expected number for ar but found: -ar` / `Error opening output files: Invalid argument` (exit 234) and the request fails with HTTP 500. Every `GET /Audio/{id}/stream.wav` that does not carry an explicit `AudioBitRate` hits this. The sample rate was already being set correctly a few lines below from `OutputAudioSampleRate`, so the line is dropped rather than repaired. - `-f s16le` overrode the muxer even for a real container. A request that did supply a bitrate (`/Audio/{id}/universal` passes `MaxStreamingBitrate`) survived the first bug but produced raw headerless samples served under an `audio/wav` content type, so clients saw a body with no RIFF header. The raw muxer is now only forced when the requested container is actually raw PCM, which keeps the I2S/MCU route from jellyfin#10321 working. Also drop the `containerInternal = ".pcm"` assignment in `StreamingHelpers.GetStreamingState`: it is written after `state.OutputContainer` has already been read from the same variable and is never read again, so it has no effect and only obscures where the output container comes from. Verified against ffmpeg 8.1.2 with a 96 kHz FLAC source: before, the wav command line exits 234; after, it produces a valid `RIFF/WAVE` 48 kHz stereo `pcm_s16le` file, while the raw `.pcm` route still yields exactly 2 s x 48000 x 2ch x 2 B = 384000 bytes of headerless samples. * Translated using Weblate (Arabic) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/ar/ * Translated using Weblate (Lithuanian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/lt/ * Translated using Weblate (Faroese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/fo/ * Translated using Weblate (Faroese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/fo/ * Fix by-name endpoints reporting TotalRecordCount=0 next to a populated Items array `GetItemValues` -- the shared path behind `/Artists`, `/AlbumArtists`, `/Genres`, `/MusicGenres` and `/Studios` -- disabled the total record count whenever the query carried no `Limit`: if (!filter.Limit.HasValue) { filter.EnableTotalRecordCount = false; } A request without an explicit limit therefore came back with N entries in `Items` and `TotalRecordCount = 0`. Clients that page on the reported total -- the documented contract every other list endpoint honours -- read that as an empty library. `/Items` and `/Persons` do not share this path and report the count correctly, which is what makes the inconsistency visible from the outside. Measured against master with a 62-track music library: GET /Artists?UserId=... -> TotalRecordCount=0 Items=5 GET /Artists?UserId=...&limit=100 -> TotalRecordCount=5 Items=5 Dropping the block costs nothing: `representativeIds` is materialised into a `List<Guid>` a few lines below regardless, so `.Count` was already available and the count is now reported from it. Callers that genuinely want to skip the count still can -- `EnableTotalRecordCount = false` is honoured as before. The block also mutated the caller's own query object, so a query instance reused across calls silently lost its total after the first limitless one. That is covered by a test as well. * Project the lowered person credit values once when updating people * Translated using Weblate (Czech) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/cs/ * Translated using Weblate (Danish) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/da/ * Translated using Weblate (Estonian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/et/ * Translated using Weblate (Spanish) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/es/ * Update dependency SharpCompress to 0.50.4 * Revert "Refresh Live TV channel icons on every guide update." This reverts commit 372c168. * Translated using Weblate (Spanish) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/es/ * Translated using Weblate (Polish) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/pl/ * Translated using Weblate (Faroese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/fo/ * Use a HashSet for existing items Makes the test O(log n) * Speed up search for existing item values Replace the O(n²) array .First scan with a dictionary lookup * Switch SQLite connection Cache to Private If left at Default, sqlite3_enable_shared_cache is process-global, so a plugin enabling it makes these connections share a cache too. Contention then surfaces as SQLITE_LOCKED ("database table is locked"), which the busy handler does not cover, busy_timeout is skipped and the command fails at CommandTimeout instead. * Fix captured (and discarded) Execute exceptions Using ExecuteAndCapture (and the async version) requires something to manage the captured exception, which we don't do. Errors would be silently dropped and the writes/deletes treated as if they succeeded. * Add warning that PessimisticLockBehavior is unsafe Since it uses ReaderWriterLockSlim, it gets tripped up if the transaction is continued across an await boundary on a different thread. * Move the deletion of old related info to just before the save This makes the deletion of BaseItemProviders, BaseItemImageInfos, and BaseItemMetadataFields happen in batch as a contiguous block so the lock isn't held across items, just before the bulk SaveChanges. * Translated using Weblate (German) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/de/ * Translated using Weblate (Hungarian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/hu/ * Cleanup and simplify query helpers * Translated using Weblate (Lithuanian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/lt/ * Apply review suggestions * Translated using Weblate (Lithuanian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/lt/ * Stop image endpoints from upscaling beyond the source resolution ImageHelper.GetNewImageSize passed the caller-supplied width/height straight through to SkiaEncoder.EncodeImage, which allocates an SKImageInfo of exactly that size. Nothing bounded those values against the source image, so a request like Items/<id>/Images/Primary?width=23100&height=23100 made the server allocate and resample a 23100x23100 surface from, say, a 600x336 poster: the reporter measured 100% of a core for 10-15 minutes and 6-12 GB resident per request. The item images endpoints do not require authentication, so any caller who knows an item id can trigger this, and varying the size by one pixel misses the cache every time. Add DrawingUtils.ScaleDownToFit, which scales a size down uniformly until it fits inside a bounding box and returns it unchanged if it already does, and apply it in GetNewImageSize against the original image dimensions. Requests that ask for more pixels than the source now get the source resolution back, scaled to the requested aspect ratio. Downscaling paths are untouched, and DrawingUtils.Resize keeps its existing behaviour for the transcoding callers in EncodingJobInfo and StreamInfo, which legitimately size video output. ResizeFill already refused to upscale; this makes width/height consistent with fillWidth/fillHeight. Fixes jellyfin#17056. * Fix EF core designer drifts * Batch people lookups when building item DTOs GetBaseItemDtos already batch fetches user data, child counts, played counts and artists before its per item loop, but AttachPeople still ran one GetPeople query per item. Rendering a page of items (for example a large playlist) fired one extra query per row. Add GetPeopleByItems to IPeopleRepository, which reads every requested item in a single query over the people mapping table and returns full PersonInfo (role, type and sort order) grouped by item id. GetBaseItemDtos prefetches this once when the People field is requested and passes it into AttachPeople, which reads from the batch instead of querying per item. The single item GetBaseItemDto path keeps its existing per item behaviour when no batch is supplied. Adds a DtoService test asserting people resolve from the batch and the per item GetPeople is never called. * Translated using Weblate (Lithuanian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/lt/ * Translated using Weblate (Lithuanian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/lt/ * Translated using Weblate (Lithuanian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/lt/ * Translated using Weblate (Turkish) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/tr/ * Batch alternate version detection in DtoService to remove MediaSourceCount N+1 Browsing a page of videos with the MediaSourceCount field ran one alternate version query per item, each opening a fresh DbContext. On a large library that turned a single page into hundreds of sequential round trips and made the Items endpoint take tens of seconds while holding a request thread the whole time. Detect which videos own alternate versions once per page with a single query, mirroring the existing people batch. Videos absent from that set have a single media source, so the per item lookups are skipped for the common case. Behavior is unchanged: a video with no alternates already resolved to a count of one. Adds a regression test asserting the count resolves from the batch and the per item lookups are never called. * Fix missing ItemRemoved events and search fallback after access filtering * Translated using Weblate (Turkish) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/tr/ * Translated using Weblate (Vietnamese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/vi/ * Translated using Weblate (Basque) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/eu/ * Translated using Weblate (Turkish) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/tr/ * Fix assemblies * Fix bump_version script * Address review on MediaSourceCount batching Rename GetItemsWithAlternateVersions to GetItemIdsWithAlternateVersions across the interfaces and implementations since it returns ids. Return the hashset straight from the query instead of materializing an array first. Rename the DtoService guard to mayHaveAlternateVersions and invert it so the computed path is the explicit case. Assert the media source count value in the batch skip test and add a test covering an item that is in the returned set still resolving to the correct count. * Safeguard against invalid provider ids * Use WhereOneOrMany helper for the alternate version id filter Filter the parent ids with the WhereOneOrMany query helper instead of a raw Contains so the id list is wrapped in EF.Parameter and EF Core reuses one compiled query plan across calls, matching how the rest of the item queries build their id filters. * Translated using Weblate (Portuguese (Brazil)) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/pt_BR/ * Translated using Weblate (Lithuanian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/lt/ * fix: correct IsAiring negation to exclude airing items * fix: bound remote provider pagination * Translated using Weblate (Russian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/ru/ * Translated using Weblate (Portuguese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/pt/ * Translated using Weblate (Vietnamese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/vi/ * Fix PersonTypes not applied when filtering by person * Update MediaBrowser.Controller/Drawing/ImageHelper.cs Co-authored-by: Tim Eisele <Tim_Eisele@web.de> * Fix master build * Fix master build * Apply review suggestions * Fix FindArtists * Update dependency z440.atl.core to 7.16.0 * Optimize query helper memory * Update Microsoft to 10.0.11 * Share the SQLite fixture across the item tests * Resolve link owners from LinkedChildren * Make the media stream filter index covering * Fix English metadata blocking localized providers ranked below it * Fix formatting * Translated using Weblate (German) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/de/ * Translated using Weblate (Lithuanian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/lt/ * Translated using Weblate (Malay) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/ms/ * Fix unit test for localization DE localization for Artists was changed in localization commit 21fec95 * Recognize WEB-DL release tags in video names * Fix other two missing DE localization DE updates Turns out there were two more instances of test broken by commit 21fec95 * Translated using Weblate (Lithuanian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/lt/ * Skip alternate version links when resolving link parents * Count alternate versions in the media filters and align filter conditions * Translated using Weblate (Galician) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/gl/ * Update dependency dotnet-ef to v10.0.11 * Update github/codeql-action action to v4.37.7 * Update dependency Microsoft.NET.Test.Sdk to 18.9.0 * Translated using Weblate (Slovak) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/sk/ * Translated using Weblate (Albanian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/sq/ * Translated using Weblate (Esperanto) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/eo/ * Translated using Weblate (Faroese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/fo/ * Use client-reported position for idle playback cleanup * Translated using Weblate (Hungarian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/hu/ * Translated using Weblate (Lithuanian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/lt/ * Translated using Weblate (Danish) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/da/ * Translated using Weblate (Portuguese (Portugal)) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/pt_PT/ * Translated using Weblate (Italian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/it/ * Translated using Weblate (Italian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/it/ * Preserve unknown idle playback position * Fix large playlist persistence * Fix SQLite variable limit in child count batches * Translated using Weblate (Russian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/ru/ * Translated using Weblate (Serbian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/sr/ * Translated using Weblate (Portuguese (Portugal)) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/pt_PT/ * Translated using Weblate (Basque) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/eu/ * Translated using Weblate (Portuguese (Portugal)) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/pt_PT/ * Translated using Weblate (Portuguese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/pt/ * Translated using Weblate (Portuguese (Portugal)) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/pt_PT/ * Translated using Weblate (Portuguese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/pt/ * Translated using Weblate (Finnish) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/fi/ * Update Microsoft to 5.9.0 * More resilient MusicBrainz lookup * Prevent orphaned user permissions and preferences (jellyfin#17643) Prevent orphaned user permissions and preferences * Translated using Weblate (Hebrew) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/he/ * Translated using Weblate (Tamil) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/ta/ * Fix Cheesegeezer GitHub URL typo in CONTRIBUTORS (jellyfin#17659) * Translated using Weblate (Portuguese (Portugal)) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/pt_PT/ * Translated using Weblate (Armenian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/hy/ * Translated using Weblate (Turkish) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/tr/ * Translated using Weblate (Portuguese (Portugal)) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/pt_PT/ * Translated using Weblate (Faroese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/fo/ * Translated using Weblate (Portuguese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/pt/ * Fix latest items for mixed libraries * Translated using Weblate (Chinese (Simplified Han script)) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/zh_Hans/ * Translated using Weblate (Chinese (Traditional Han script, Hong Kong)) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/zh_Hant_HK/ * Translated using Weblate (Chinese (Traditional Han script)) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/zh_Hant/ * Stop user updates from orphaning permission and preference rows (jellyfin#17645) * Stop user updates from orphaning permission and preference rows * Make UserId non-nullable * Remove unnecessary ToList * Update Jellyfin.Server.Implementations/Users/UserManager.cs Co-authored-by: Claus Vium <cvium@users.noreply.github.com> --------- Co-authored-by: Claus Vium <cvium@users.noreply.github.com> * Translated using Weblate (Swedish) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/sv/ * Allow direct play for HDHomeRun tuners * Translated using Weblate (Romanian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/ro/ * Fix GHSA-wwwm-px48-fpvq # Conflicts: # MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs * Normalize fix, apply in more places * Translated using Weblate (English (United Kingdom)) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/en_GB/ * Fall back to the ancestor filter when a view has no top parents * Fix series merging leaking across libraries and under-counting merged children * Use WhereOneOrMany * Multiple fixes and improvements Co-Authored-By: Cody Robibero <cody@robibe.ro> * Mark breakOnNonKeyFrames as XMLIgnore * Additional fixes Co-Authored-By: Cody Robibero <cody@robibe.ro> * Look up people by item via the credit map instead of a full scan * Adapt to master * Translated using Weblate (Faroese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/fo/ * Translated using Weblate (Faroese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/fo/ * Translated using Weblate (Bulgarian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/bg/ * Fix person metadata not being fetched on demand or by the people task * Translated using Weblate (English (United Kingdom)) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/en_GB/ * Translated using Weblate (Portuguese (Brazil)) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/pt_BR/ * Translated using Weblate (Hindi) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/hi/ * Use FullRefresh * Translated using Weblate (Lithuanian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/lt/ --------- Co-authored-by: krvi <27792771+krvi@users.noreply.github.com> Co-authored-by: Shadowghost <Ghost_of_Stone@web.de> Co-authored-by: Cody Robibero <cody@robibe.ro> Co-authored-by: Bas <44002186+854562@users.noreply.github.com> Co-authored-by: Gargotaire <gargots@gmail.com> Co-authored-by: 無情天 <kofzhanganguo@126.com> Co-authored-by: Kaz <vasiebert@icloud.com> Co-authored-by: Robin <rbnn37@gmail.com> Co-authored-by: rlauuzo <46294892+rlauuzo@users.noreply.github.com> Co-authored-by: Translation expert <eleceng4ever@hotmail.com> Co-authored-by: myrad2267 <37258280+myrad2267@users.noreply.github.com> Co-authored-by: Vincenzo Reale <smart2128vr@gmail.com> Co-authored-by: nextlooper42 <nextlooper42@protonmail.com> Co-authored-by: Vitalijus <vitalijus.n@gmail.com> Co-authored-by: Erik W <erikwallhede@gmail.com> Co-authored-by: potuzhnyj <ivvvvvca@gmail.com> Co-authored-by: Yunseo Jung <samsunghappytree123@naver.com> Co-authored-by: Shed Shedson <hjorturthorgeirs+hmp1devq@gmail.com> Co-authored-by: gnattu <gnattuoc@me.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: vdatanet <joan@vdata.net> Co-authored-by: Bond-009 <bond.009@outlook.com> Co-authored-by: Helak <adamhavra@seznam.cz> Co-authored-by: Dan Johansen <strit@strits.dk> Co-authored-by: rimasx <riks_12@hot.ee> Co-authored-by: Luis Fernando Illapa <moxb@outlook.es> Co-authored-by: theguymadmax <theguymadmax@proton.me> Co-authored-by: Kityn <kitynska@gmail.com> Co-authored-by: Marc Brooks <IDisposable@gmail.com> Co-authored-by: simonanter <simon.anter@tutamail.com> Co-authored-by: Keleti Márton <tejes@hac.hu> Co-authored-by: vavallee <vavallee@protonmail.com> Co-authored-by: brandon <brandon@clinger.dev> Co-authored-by: queeup <queeup@zoho.com> Co-authored-by: hoanghuy309 <hoanghuy309@gmail.com> Co-authored-by: Thadah D. Denyse <thadahdenyse@protonmail.com> Co-authored-by: Doougfoks <doougfoks@hotmail.com> Co-authored-by: TOomaAh <tbrunet72@gmail.com> Co-authored-by: Dan Tsivinsky <daniil@tsivinsky.com> Co-authored-by: Kiki <jellyfin.chair777@passmail.com> Co-authored-by: Tim Eisele <Tim_Eisele@web.de> Co-authored-by: Psychotrickser <Merih1998@googlemail.com> Co-authored-by: ZeroAiden <zeroaiden.game@gmail.com> Co-authored-by: st7105 <437758+st7105@users.noreply.github.com> Co-authored-by: José Tojeiro <outrocolacao@users.noreply.translate.jellyfin.org> Co-authored-by: dodog <preklady@mayday.sk> Co-authored-by: AlaronAndes <diaforeseggrafes@gmail.com> Co-authored-by: VeryUsual <72707293+VeryUsual@users.noreply.github.com> Co-authored-by: itsb <itsb@users.noreply.github.com> Co-authored-by: KecskeTech <teonyitas@gmail.com> Co-authored-by: Ulrik <ulrik@users.noreply.translate.jellyfin.org> Co-authored-by: Pedro Fonseca <pefonseca10@gmail.com> Co-authored-by: Andrea Baitelli <andrea@baitelli.it> Co-authored-by: martin-77 <52350479+martin-77@users.noreply.github.com> Co-authored-by: Gallyam Biktashev <gallyamb@gmail.com> Co-authored-by: nenadsuperzmaj <nenadsuperzmaj@gmail.com> Co-authored-by: Emanuel Lopes <emanuel.lopes.pt@gmail.com> Co-authored-by: Blackspirits <blackspirits@gmail.com> Co-authored-by: aleksantero <roiha.aleksanteri@gmail.com> Co-authored-by: m0g3r <87276771+m0g3r@users.noreply.github.com> Co-authored-by: Jonathan Biton <jonathannbiton@gmail.com> Co-authored-by: deepak r <deepak.r232629@gmail.com> Co-authored-by: MoonsvnLyn <FirmaSpring@outlook.com> Co-authored-by: MakeMike <mikevahe2006@gmail.com> Co-authored-by: Ömür Ege Kiraz <omrkrz0678@gmail.com> Co-authored-by: Jacky He <hekinghung@gmail.com> Co-authored-by: Claus Vium <cvium@users.noreply.github.com> Co-authored-by: therealhampus <hampus.eriksson@proton.me> Co-authored-by: Gabriel Popa <me@gabrielpopa.com> Co-authored-by: Joel Sprouse <joel.sprouse11@gmail.com> Co-authored-by: Koralski <bkoralski@gmail.com> Co-authored-by: DeaDvey <github@deadvey.xyz> Co-authored-by: chiphead2332 <chiphead@gmail.com> Co-authored-by: Karan Singh BHardwaj <bhardwaj00009@gmail.com> Co-authored-by: GitHub Copilot <copilot@github.com>
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.
Extension of #17643 - Thanks to @m0g3r for finding the cause and providing the initial fix
UpdateUserAsynccleared and rebuilt the permission and preference collections on every call. Both foreign keys were nullable, soClear()made EF sever the relationship viaUPDATE ... SET UserId = NULLinstead of deleting. The latter lead to rows that were neveer removed even though we haveON DELETE CASCADEset.Changes
Both collections are now reconciled in place, matching on
Kind, which stops the leak and leaves the child rows untouched when only the user row changed.Permission.UserIdandPreference.UserIdare now non-nullable, so the relationship can no longer be severed and cascade delete cleans up on user removal (existing bad data is cleaned up via a migration).Code assistance
Claude Opus 5 was used for the tests.
Issues
Fixes #17601