diff options
| author | theguymadmax <theguymadmax@proton.me> | 2026-06-19 23:10:32 -0400 |
|---|---|---|
| committer | theguymadmax <theguymadmax@proton.me> | 2026-06-19 23:10:32 -0400 |
| commit | 310a47c1d4f241346cc4cda4e025758bf1e6247c (patch) | |
| tree | 88e10395371c551b9424fddb5efc60153731a787 /Emby.Server.Implementations | |
| parent | 24886d48494ab579c860654a908dbbe7fa5b8525 (diff) | |
Reorder ValidatePeople
Diffstat (limited to 'Emby.Server.Implementations')
| -rw-r--r-- | Emby.Server.Implementations/ScheduledTasks/Tasks/PeopleValidationTask.cs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/PeopleValidationTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/PeopleValidationTask.cs index abe75c8d67..96483ced99 100644 --- a/Emby.Server.Implementations/ScheduledTasks/Tasks/PeopleValidationTask.cs +++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/PeopleValidationTask.cs @@ -75,13 +75,10 @@ public class PeopleValidationTask : IScheduledTask, IConfigurableScheduledTask /// <inheritdoc /> public async Task ExecuteAsync(IProgress<double> progress, CancellationToken cancellationToken) { - IProgress<double> subProgress = new Progress<double>((val) => progress.Report(val / 3)); - await _libraryManager.ValidatePeopleAsync(subProgress, cancellationToken).ConfigureAwait(false); - var context = await _dbContextFactory.CreateDbContextAsync(cancellationToken).ConfigureAwait(false); await using (context.ConfigureAwait(false)) { - subProgress = new Progress<double>((val) => progress.Report((val / 3) + 33)); + IProgress<double> subProgress = new Progress<double>((val) => progress.Report(val / 2)); var dupQuery = context.Peoples .GroupBy(e => new { e.Name, e.PersonType }) .Where(e => e.Count() > 1) @@ -127,14 +124,18 @@ public class PeopleValidationTask : IScheduledTask, IConfigurableScheduledTask ArrayPool<Guid[]>.Shared.Return(buffer); } - subProgress.Report(100); var peopleToDelete = await context.Peoples .Where(p => !context.PeopleBaseItemMap.Any(m => m.PeopleId.Equals(p.Id))) .ExecuteDeleteAsync(cancellationToken) .ConfigureAwait(false); _logger.LogInformation("Removed {Count} orphaned people.", peopleToDelete); - progress.Report(100); + subProgress.Report(100); } + + IProgress<double> validateProgress = new Progress<double>((val) => progress.Report((val / 2) + 50)); + await _libraryManager.ValidatePeopleAsync(validateProgress, cancellationToken).ConfigureAwait(false); + + progress.Report(100); } } |
