mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Use local var for the length
This commit is contained in:
parent
9a5a079f42
commit
f92806c246
@ -62,10 +62,11 @@ public class KeyframeExtractionScheduledTask : IScheduledTask
|
|||||||
};
|
};
|
||||||
|
|
||||||
var videos = _libraryManager.GetItemList(query);
|
var videos = _libraryManager.GetItemList(query);
|
||||||
|
var numberOfVideos = videos.Count;
|
||||||
var numComplete = 0;
|
var numComplete = 0;
|
||||||
|
|
||||||
// TODO parallelize with Parallel.ForEach?
|
// TODO parallelize with Parallel.ForEach?
|
||||||
for (var i = 0; i < videos.Count; i++)
|
for (var i = 0; i < numberOfVideos; i++)
|
||||||
{
|
{
|
||||||
var video = videos[i];
|
var video = videos[i];
|
||||||
// Only local files supported
|
// Only local files supported
|
||||||
@ -86,7 +87,7 @@ public class KeyframeExtractionScheduledTask : IScheduledTask
|
|||||||
|
|
||||||
// Update progress
|
// Update progress
|
||||||
numComplete++;
|
numComplete++;
|
||||||
double percent = (double)numComplete / videos.Count;
|
double percent = (double)numComplete / numberOfVideos;
|
||||||
|
|
||||||
progress.Report(100 * percent);
|
progress.Report(100 * percent);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user