Add parallelism
This commit is contained in:
parent
08c6c48934
commit
12d53d52c0
@ -85,14 +85,14 @@ public class FingerprinterTask : IScheduledTask
|
|||||||
var queue = Plugin.Instance!.AnalysisQueue;
|
var queue = Plugin.Instance!.AnalysisQueue;
|
||||||
var totalProcessed = 0;
|
var totalProcessed = 0;
|
||||||
|
|
||||||
foreach (var season in queue)
|
Parallel.ForEach(queue, (season) =>
|
||||||
{
|
{
|
||||||
AnalyzeSeason(season, cancellationToken);
|
AnalyzeSeason(season, cancellationToken);
|
||||||
|
|
||||||
// TODO: report progress on a per episode basis
|
// TODO: report progress on a per episode basis
|
||||||
totalProcessed += season.Value.Count;
|
totalProcessed += season.Value.Count;
|
||||||
progress.Report((totalProcessed * 100) / Plugin.Instance!.TotalQueued);
|
progress.Report((totalProcessed * 100) / Plugin.Instance!.TotalQueued);
|
||||||
}
|
});
|
||||||
|
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user