mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 01:24:44 +01:00
Merge pull request #11352 from jellyfin/fix-library-removal
fix: explicitly allow remove root when performing library removal
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user