diff options
| author | Bond-009 <bond.009@outlook.com> | 2024-04-18 12:16:04 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-18 12:16:04 +0200 |
| commit | 37d301ebd40520bb3719baa14420d98c168dd8da (patch) | |
| tree | 8cede2013c67efefdb696239aec5ce63cd3277fc /Emby.Server.Implementations/Library/LibraryManager.cs | |
| parent | 81d37587854bcc73102f09cf49a9bf79eb71c298 (diff) | |
| parent | 1b567efeb5f4720f3d64a03359d420f83a3b781c (diff) | |
Merge pull request #11352 from jellyfin/fix-library-removal
fix: explicitly allow remove root when performing library removal
Diffstat (limited to 'Emby.Server.Implementations/Library/LibraryManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Library/LibraryManager.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 03002300c..7b3871a9b 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -1030,7 +1030,7 @@ namespace Emby.Server.Implementations.Library } } - private async Task ValidateTopLibraryFolders(CancellationToken cancellationToken) + private async Task ValidateTopLibraryFolders(CancellationToken cancellationToken, bool removeRoot = false) { await RootFolder.RefreshMetadata(cancellationToken).ConfigureAwait(false); @@ -1039,7 +1039,7 @@ namespace Emby.Server.Implementations.Library new Progress<double>(), new MetadataRefreshOptions(new DirectoryService(_fileSystem)), recursive: false, - cancellationToken).ConfigureAwait(false); + cancellationToken: cancellationToken).ConfigureAwait(false); await GetUserRootFolder().RefreshMetadata(cancellationToken).ConfigureAwait(false); @@ -1047,7 +1047,8 @@ namespace Emby.Server.Implementations.Library new Progress<double>(), new MetadataRefreshOptions(new DirectoryService(_fileSystem)), recursive: false, - cancellationToken).ConfigureAwait(false); + allowRemoveRoot: removeRoot, + cancellationToken: cancellationToken).ConfigureAwait(false); // Quickly scan CollectionFolders for changes foreach (var folder in GetUserRootFolder().Children.OfType<Folder>()) @@ -1065,7 +1066,7 @@ namespace Emby.Server.Implementations.Library var innerProgress = new Progress<double>(pct => progress.Report(pct * 0.96)); // Validate the entire media library - await RootFolder.ValidateChildren(innerProgress, new MetadataRefreshOptions(new DirectoryService(_fileSystem)), recursive: true, cancellationToken).ConfigureAwait(false); + await RootFolder.ValidateChildren(innerProgress, new MetadataRefreshOptions(new DirectoryService(_fileSystem)), recursive: true, cancellationToken: cancellationToken).ConfigureAwait(false); progress.Report(96); @@ -3119,7 +3120,7 @@ namespace Emby.Server.Implementations.Library if (refreshLibrary) { - await ValidateTopLibraryFolders(CancellationToken.None).ConfigureAwait(false); + await ValidateTopLibraryFolders(CancellationToken.None, true).ConfigureAwait(false); StartScanInBackground(); } |
