Add newline on download progress failure

This commit is contained in:
bytedream 2022-03-26 19:33:14 +01:00
parent 8e791f7e8b
commit 36ecbb0cd7
2 changed files with 10 additions and 0 deletions

View file

@ -274,6 +274,11 @@ func archiveInfo(info formatInformation, writeCloser io.WriteCloser, filename st
if err != nil {
return fmt.Errorf("error while setting up downloader: %v", err)
}
defer func() {
if downloadProgress.Total != downloadProgress.Current {
fmt.Println()
}
}()
rootFile, err := os.CreateTemp("", fmt.Sprintf("%s_*.ts", strings.TrimSuffix(filepath.Base(filename), filepath.Ext(filename))))
if err != nil {

View file

@ -190,6 +190,11 @@ func downloadInfo(info formatInformation, file *os.File) error {
if out.IsDev() {
downloadProgress.Prefix = out.DebugLog.Prefix()
}
defer func() {
if downloadProgress.Total != downloadProgress.Current {
fmt.Println()
}
}()
ctx, cancel := context.WithCancel(context.Background())
defer cancel()