diff options
| author | orut34iop <orut34iop@users.noreply.github.com> | 2026-09-15 11:16:58 -0400 |
|---|---|---|
| committer | Cody Robibero <cody@robibe.ro> | 2026-09-15 11:16:58 -0400 |
| commit | 42245b9b25ef278abc1127c543357aeecf8de6d0 (patch) | |
| tree | 19919deadf4d35d1c5767cbeca2720b22472bf69 /MediaBrowser.Controller | |
| parent | 28be079779d4508b5ab2a2fd4b482f3fd929ced5 (diff) | |
Backport pull request #18007 from jellyfin/release-12.z
Preserve library items when directory enumeration fails
Original-merge: 63def185b199c5afded850b8eb5667276bc864f9
Merged-by: crobibero <cody@robibe.ro>
Backported-by: Cody Robibero <cody@robibe.ro>
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Entities/Folder.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 25e19c8351..dae4612aa1 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -429,19 +429,23 @@ namespace MediaBrowser.Controller.Entities if (IsFileProtocol) { - IEnumerable<BaseItem> nonCachedChildren = []; + IEnumerable<BaseItem> nonCachedChildren; try { - nonCachedChildren = GetNonCachedChildren(directoryService); + // Finish enumeration before mutating the library. An I/O failure, including + // one partway through a lazy enumeration, must not look like removed files. + nonCachedChildren = GetNonCachedChildren(directoryService).ToArray(); } catch (IOException ex) { Logger.LogError(ex, "Error retrieving children from file system"); + return; } catch (SecurityException ex) { Logger.LogError(ex, "Error retrieving children from file system"); + return; } catch (Exception ex) { |
