Fixed dedupe cache check not running in every loop iteration

This commit is contained in:
N00MKRAD
2021-02-11 00:08:22 +01:00
parent 260856db72
commit 3854dc5b7e
2 changed files with 10 additions and 11 deletions

View File

@@ -127,18 +127,18 @@ namespace Flowframes.Magick
currentDupeCount = 0;
break;
}
if (sw.ElapsedMilliseconds >= 500 || (i+1) == framePaths.Length) // Print every 0.5s (or when done)
{
sw.Restart();
Logger.Log($"[Deduplication] Running de-duplication ({i}/{framePaths.Length}), deleted {statsFramesDeleted} ({(((float)statsFramesDeleted / framePaths.Length) * 100f).ToString("0")}%) duplicate frames so far...", false, true);
Program.mainForm.SetProgress((int)Math.Round(((float)i / framePaths.Length) * 100f));
if (imageCache.Count > bufferSize || (imageCache.Count > 50 && OSUtils.GetFreeRamMb() < 3500))
ClearCache();
}
}
}
if (sw.ElapsedMilliseconds >= 500 || (i + 1) == framePaths.Length) // Print every 0.5s (or when done)
{
sw.Restart();
Logger.Log($"[Deduplication] Running de-duplication ({i}/{framePaths.Length}), deleted {statsFramesDeleted} ({(((float)statsFramesDeleted / framePaths.Length) * 100f).ToString("0")}%) duplicate frames so far...", false, true);
Program.mainForm.SetProgress((int)Math.Round(((float)i / framePaths.Length) * 100f));
if (imageCache.Count > bufferSize || (imageCache.Count > 50 && OSUtils.GetFreeRamMb() < 3500))
ClearCache();
}
// int oldIndex = -1; // TODO: Compare with 1st to fix loops?
// if (i >= framePaths.Length) // If this is the last frame, compare with 1st to avoid OutOfRange error
// {
@@ -146,7 +146,7 @@ namespace Flowframes.Magick
// i = 0;
// }
if(i % 3 == 0)
if (i % 3 == 0)
await Task.Delay(1);
if (Interpolate.canceled) return;

View File

@@ -223,7 +223,6 @@ namespace Flowframes
}
else
{
Logger.Log("Deleting temp folder because current.stepByStep = " + current.stepByStep);
IOUtils.TryDeleteIfExists(current.tempFolder);
}
}