From d68382e418f0d5588b912be2bdc9e164609e7f60 Mon Sep 17 00:00:00 2001 From: Leonid Nikitin Date: Sat, 27 Jan 2024 21:08:27 +0600 Subject: [PATCH] Fixed a bug when the video was fully converted, but the progress bar showed not 100, but, for example, 99. --- src/handler/convertor.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/handler/convertor.go b/src/handler/convertor.go index e1de919..919b2f4 100644 --- a/src/handler/convertor.go +++ b/src/handler/convertor.go @@ -163,9 +163,6 @@ func (p progress) Run(stdOut io.ReadCloser, stdErr io.ReadCloser) error { scannerOut := bufio.NewScanner(stdOut) for scannerOut.Scan() { - if isProcessCompleted != true { - isProcessCompleted = true - } data := scannerOut.Text() re := regexp.MustCompile(`frame=(\d+)`) a := re.FindAllStringSubmatch(data, -1) @@ -181,6 +178,7 @@ func (p progress) Run(stdOut io.ReadCloser, stdErr io.ReadCloser) error { p.progressbar.Value = p.totalDuration p.progressbar.Refresh() isProcessCompleted = true + break } if p.progressbar.Value != progress { p.progressbar.Value = progress