[PR #14925] [MERGED] Fix collections folder duplication #14181

Closed
opened 2026-02-07 07:25:43 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/14925
Author: @theguymadmax
Created: 10/2/2025
Status: Merged
Merged: 10/8/2025
Merged by: @crobibero

Base: masterHead: double-collections-fix


📝 Commits (1)

  • 76d7c6e Fix collections folder duplication

📊 Changes

1 file changed (+2 additions, -0 deletions)

View changed files

📝 Emby.Server.Implementations/Collections/CollectionManager.cs (+2 -0)

📄 Description

Changes

  • Invalidate RootFolder.Children cache after creating collections virtual folder

Issues
Fixes a bug where creating the collections folder during library scans would fail with an error and/or create duplicate "Collections" libraries in the UI.

Log Error
[23:29:17] [ERR] [82] Emby.Server.Implementations.Library.Validators.CollectionPostScanTask: Error refreshing Caminandes Collection with ["174d3cdb-1345-dc0b-bc8a-799068c5dcc7", "165c9d15-9367-45a2-8b0c-741fd0409d90", "ba8518a9-9969-f900-6808-8ef81424657b"]
System.InvalidOperationException: Sequence contains no elements
   at System.Linq.ThrowHelper.ThrowNoElementsException()
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at Emby.Server.Implementations.Collections.CollectionManager.EnsureLibraryFolder(String path, Boolean createIfNeeded) in C:\git\jellyfin\Emby.Server.Implementations\Collections\CollectionManager.cs:line 107
   at Emby.Server.Implementations.Collections.CollectionManager.CreateCollectionAsync(CollectionCreationOptions options) in C:\git\jellyfin\Emby.Server.Implementations\Collections\CollectionManager.cs:line 140
   at Emby.Server.Implementations.Library.Validators.CollectionPostScanTask.Run(IProgress`1 progress, CancellationToken cancellationToken) in C:\git\jellyfin\Emby.Server.Implementations\Library\Validators\CollectionPostScanTask.cs:line 125
[23:29:17] [ERR] [82] Microsoft.EntityFrameworkCore.Database.Connection: An error occurred using the connection to database 'main' on server 'C:\Users\Max\AppData\Local\jellyfin\data\jellyfin.db'.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/14925 **Author:** [@theguymadmax](https://github.com/theguymadmax) **Created:** 10/2/2025 **Status:** ✅ Merged **Merged:** 10/8/2025 **Merged by:** [@crobibero](https://github.com/crobibero) **Base:** `master` ← **Head:** `double-collections-fix` --- ### 📝 Commits (1) - [`76d7c6e`](https://github.com/jellyfin/jellyfin/commit/76d7c6ee619bfb59489fc724fd4934ec3ac63084) Fix collections folder duplication ### 📊 Changes **1 file changed** (+2 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `Emby.Server.Implementations/Collections/CollectionManager.cs` (+2 -0) </details> ### 📄 Description <!-- Ensure your title is short, descriptive, and in the imperative mood (Fix X, Change Y, instead of Fixed X, Changed Y). For a good inspiration of what to write in commit messages and PRs please review https://chris.beams.io/posts/git-commit/ and our documentation. --> **Changes** - Invalidate `RootFolder.Children` cache after creating collections virtual folder **Issues** Fixes a bug where creating the collections folder during library scans would fail with an error and/or create duplicate "Collections" libraries in the UI. <details> <summary>Log Error</summary> ``` [23:29:17] [ERR] [82] Emby.Server.Implementations.Library.Validators.CollectionPostScanTask: Error refreshing Caminandes Collection with ["174d3cdb-1345-dc0b-bc8a-799068c5dcc7", "165c9d15-9367-45a2-8b0c-741fd0409d90", "ba8518a9-9969-f900-6808-8ef81424657b"] System.InvalidOperationException: Sequence contains no elements at System.Linq.ThrowHelper.ThrowNoElementsException() at System.Linq.Enumerable.First[TSource](IEnumerable`1 source) at Emby.Server.Implementations.Collections.CollectionManager.EnsureLibraryFolder(String path, Boolean createIfNeeded) in C:\git\jellyfin\Emby.Server.Implementations\Collections\CollectionManager.cs:line 107 at Emby.Server.Implementations.Collections.CollectionManager.CreateCollectionAsync(CollectionCreationOptions options) in C:\git\jellyfin\Emby.Server.Implementations\Collections\CollectionManager.cs:line 140 at Emby.Server.Implementations.Library.Validators.CollectionPostScanTask.Run(IProgress`1 progress, CancellationToken cancellationToken) in C:\git\jellyfin\Emby.Server.Implementations\Library\Validators\CollectionPostScanTask.cs:line 125 [23:29:17] [ERR] [82] Microsoft.EntityFrameworkCore.Database.Connection: An error occurred using the connection to database 'main' on server 'C:\Users\Max\AppData\Local\jellyfin\data\jellyfin.db'. ``` </details> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 07:25:43 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#14181