adding more debugging to time percentage

This commit is contained in:
reven
2022-01-13 20:23:17 +13:00
parent c68e6df3d4
commit d98ce25084
2 changed files with 5 additions and 0 deletions

View File

@@ -164,6 +164,7 @@ namespace FileFlows.VideoNodes
{
var timeString = rgxTime.Match(e.Data).Value;
var ts = TimeSpan.Parse(timeString);
Logger.DLog("TimeSpan Detected: " + ts);
if (AtTime != null)
AtTime.Invoke(ts);
}

View File

@@ -57,8 +57,12 @@ namespace FileFlows.VideoNodes
void AtTimeEvent(TimeSpan time)
{
if (TotalTime.TotalMilliseconds == 0)
{
args?.Logger?.DLog("Can't report time progress as total time is 0");
return;
}
float percent = (float)((time.TotalMilliseconds / TotalTime.TotalMilliseconds) * 100);
args?.Logger?.ILog($"Time Percent: {percent} ({time.TotalMilliseconds}) ({TotalTime.TotalMilliseconds})");
args?.PartPercentageUpdate(percent);
}