Improve "Cancel" in batch burn-in - thx Leon :)

Fix  #8248
This commit is contained in:
niksedk 2024-04-24 07:34:58 +02:00
parent 452504a5cb
commit 88fa93fef8

View File

@ -452,6 +452,11 @@ namespace Nikse.SubtitleEdit.Forms
var failCount = 0;
for (var index = 0; index < _batchVideoAndSubList.Count; index++)
{
if (_abort)
{
break;
}
labelPleaseWait.Text = $"{index + 1}/{_batchVideoAndSubList.Count} - {LanguageSettings.Current.General.PleaseWait}";
var videoAndSub = _batchVideoAndSubList[index];
_videoInfo = UiUtil.GetVideoInfo(videoAndSub.VideoFileName);
@ -520,6 +525,18 @@ namespace Nikse.SubtitleEdit.Forms
// ignore
}
}
if (_abort && File.Exists(VideoFileName) && new FileInfo(VideoFileName).Length < 2_000)
{
try
{
File.Delete(VideoFileName);
}
catch
{
// ignore
}
}
}
sbInfo.AppendLine();