Use local var for the length

This commit is contained in:
cvium 2022-01-11 23:32:39 +01:00
parent 9a5a079f42
commit f92806c246

View File

@ -62,10 +62,11 @@ public class KeyframeExtractionScheduledTask : IScheduledTask
};
var videos = _libraryManager.GetItemList(query);
var numberOfVideos = videos.Count;
var numComplete = 0;
// TODO parallelize with Parallel.ForEach?
for (var i = 0; i < videos.Count; i++)
for (var i = 0; i < numberOfVideos; i++)
{
var video = videos[i];
// Only local files supported
@ -86,7 +87,7 @@ public class KeyframeExtractionScheduledTask : IScheduledTask
// Update progress
numComplete++;
double percent = (double)numComplete / videos.Count;
double percent = (double)numComplete / numberOfVideos;
progress.Report(100 * percent);
}