aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Library/Validators/PeopleValidator.cs
diff options
context:
space:
mode:
authorpokreman06 <112423673+pokreman06@users.noreply.github.com>2025-10-02 11:07:05 -0600
committerGitHub <noreply@github.com>2025-10-02 11:07:05 -0600
commit0b4854c5eff7c862d05f43048e08dd3a1a25efaa (patch)
treea4c417af05deef7878ab9342c85c506ad22e1ced /Emby.Server.Implementations/Library/Validators/PeopleValidator.cs
parentd6a1c8413c6a213f6e579246c1b85aad9b028b3a (diff)
parent0f42aa892e0a7fe2ac4e680e7647515af0909e5e (diff)
Merge branch 'jellyfin:master' into master
Diffstat (limited to 'Emby.Server.Implementations/Library/Validators/PeopleValidator.cs')
-rw-r--r--Emby.Server.Implementations/Library/Validators/PeopleValidator.cs22
1 files changed, 10 insertions, 12 deletions
diff --git a/Emby.Server.Implementations/Library/Validators/PeopleValidator.cs b/Emby.Server.Implementations/Library/Validators/PeopleValidator.cs
index b7fd24fa5c..f9a6f0d19e 100644
--- a/Emby.Server.Implementations/Library/Validators/PeopleValidator.cs
+++ b/Emby.Server.Implementations/Library/Validators/PeopleValidator.cs
@@ -1,5 +1,5 @@
using System;
-using System.Globalization;
+using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Data.Enums;
@@ -55,6 +55,8 @@ public class PeopleValidator
var numPeople = people.Count;
+ IProgress<double> subProgress = new Progress<double>((val) => progress.Report(val / 2));
+
_logger.LogDebug("Will refresh {Amount} people", numPeople);
foreach (var person in people)
@@ -92,7 +94,7 @@ public class PeopleValidator
double percent = numComplete;
percent /= numPeople;
- progress.Report(100 * percent);
+ subProgress.Report(100 * percent);
}
var deadEntities = _libraryManager.GetItemList(new InternalItemsQuery
@@ -102,17 +104,13 @@ public class PeopleValidator
IsLocked = false
});
- foreach (var item in deadEntities)
- {
- _logger.LogInformation("Deleting dead {ItemType} {ItemId} {ItemName}", item.GetType().Name, item.Id.ToString("N", CultureInfo.InvariantCulture), item.Name);
+ subProgress = new Progress<double>((val) => progress.Report((val / 2) + 50));
- _libraryManager.DeleteItem(
- item,
- new DeleteOptions
- {
- DeleteFileLocation = false
- },
- false);
+ var i = 0;
+ foreach (var item in deadEntities.Chunk(500))
+ {
+ _libraryManager.DeleteItemsUnsafeFast(item);
+ subProgress.Report(100f / deadEntities.Count * (i++ * 100));
}
progress.Report(100);