Add progress report

This commit is contained in:
cvium 2022-01-11 23:31:55 +01:00
parent 6ffa9539bb
commit 9a5a079f42

View file

@ -62,6 +62,7 @@ public class KeyframeExtractionScheduledTask : IScheduledTask
};
var videos = _libraryManager.GetItemList(query);
var numComplete = 0;
// TODO parallelize with Parallel.ForEach?
for (var i = 0; i < videos.Count; i++)
@ -82,6 +83,12 @@ public class KeyframeExtractionScheduledTask : IScheduledTask
break;
}
}
// Update progress
numComplete++;
double percent = (double)numComplete / videos.Count;
progress.Report(100 * percent);
}
return Task.CompletedTask;