|
@@ -22,7 +22,6 @@ using Jellyfin.Data.Entities;
|
|
using Jellyfin.Data.Enums;
|
|
using Jellyfin.Data.Enums;
|
|
using Jellyfin.Extensions;
|
|
using Jellyfin.Extensions;
|
|
using MediaBrowser.Common.Extensions;
|
|
using MediaBrowser.Common.Extensions;
|
|
-using MediaBrowser.Common.Progress;
|
|
|
|
using MediaBrowser.Controller;
|
|
using MediaBrowser.Controller;
|
|
using MediaBrowser.Controller.Configuration;
|
|
using MediaBrowser.Controller.Configuration;
|
|
using MediaBrowser.Controller.Drawing;
|
|
using MediaBrowser.Controller.Drawing;
|
|
@@ -1022,7 +1021,7 @@ namespace Emby.Server.Implementations.Library
|
|
|
|
|
|
// Start by just validating the children of the root, but go no further
|
|
// Start by just validating the children of the root, but go no further
|
|
await RootFolder.ValidateChildren(
|
|
await RootFolder.ValidateChildren(
|
|
- new SimpleProgress<double>(),
|
|
|
|
|
|
+ new Progress<double>(),
|
|
new MetadataRefreshOptions(new DirectoryService(_fileSystem)),
|
|
new MetadataRefreshOptions(new DirectoryService(_fileSystem)),
|
|
recursive: false,
|
|
recursive: false,
|
|
cancellationToken).ConfigureAwait(false);
|
|
cancellationToken).ConfigureAwait(false);
|
|
@@ -1030,7 +1029,7 @@ namespace Emby.Server.Implementations.Library
|
|
await GetUserRootFolder().RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
|
await GetUserRootFolder().RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
|
|
|
|
|
await GetUserRootFolder().ValidateChildren(
|
|
await GetUserRootFolder().ValidateChildren(
|
|
- new SimpleProgress<double>(),
|
|
|
|
|
|
+ new Progress<double>(),
|
|
new MetadataRefreshOptions(new DirectoryService(_fileSystem)),
|
|
new MetadataRefreshOptions(new DirectoryService(_fileSystem)),
|
|
recursive: false,
|
|
recursive: false,
|
|
cancellationToken).ConfigureAwait(false);
|
|
cancellationToken).ConfigureAwait(false);
|
|
@@ -1048,18 +1047,14 @@ namespace Emby.Server.Implementations.Library
|
|
|
|
|
|
await ValidateTopLibraryFolders(cancellationToken).ConfigureAwait(false);
|
|
await ValidateTopLibraryFolders(cancellationToken).ConfigureAwait(false);
|
|
|
|
|
|
- var innerProgress = new ActionableProgress<double>();
|
|
|
|
-
|
|
|
|
- innerProgress.RegisterAction(pct => progress.Report(pct * 0.96));
|
|
|
|
|
|
+ var innerProgress = new Progress<double>(pct => progress.Report(pct * 0.96));
|
|
|
|
|
|
// Validate the entire media library
|
|
// 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).ConfigureAwait(false);
|
|
|
|
|
|
progress.Report(96);
|
|
progress.Report(96);
|
|
|
|
|
|
- innerProgress = new ActionableProgress<double>();
|
|
|
|
-
|
|
|
|
- innerProgress.RegisterAction(pct => progress.Report(96 + (pct * .04)));
|
|
|
|
|
|
+ innerProgress = new Progress<double>(pct => progress.Report(96 + (pct * .04)));
|
|
|
|
|
|
await RunPostScanTasks(innerProgress, cancellationToken).ConfigureAwait(false);
|
|
await RunPostScanTasks(innerProgress, cancellationToken).ConfigureAwait(false);
|
|
|
|
|
|
@@ -1081,12 +1076,10 @@ namespace Emby.Server.Implementations.Library
|
|
|
|
|
|
foreach (var task in tasks)
|
|
foreach (var task in tasks)
|
|
{
|
|
{
|
|
- var innerProgress = new ActionableProgress<double>();
|
|
|
|
-
|
|
|
|
// Prevent access to modified closure
|
|
// Prevent access to modified closure
|
|
var currentNumComplete = numComplete;
|
|
var currentNumComplete = numComplete;
|
|
|
|
|
|
- innerProgress.RegisterAction(pct =>
|
|
|
|
|
|
+ var innerProgress = new Progress<double>(pct =>
|
|
{
|
|
{
|
|
double innerPercent = pct;
|
|
double innerPercent = pct;
|
|
innerPercent /= 100;
|
|
innerPercent /= 100;
|
|
@@ -2954,7 +2947,7 @@ namespace Emby.Server.Implementations.Library
|
|
Task.Run(() =>
|
|
Task.Run(() =>
|
|
{
|
|
{
|
|
// No need to start if scanning the library because it will handle it
|
|
// No need to start if scanning the library because it will handle it
|
|
- ValidateMediaLibrary(new SimpleProgress<double>(), CancellationToken.None);
|
|
|
|
|
|
+ ValidateMediaLibrary(new Progress<double>(), CancellationToken.None);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|