From c9ced6571cd90521c817d35bf643714f918c62a9 Mon Sep 17 00:00:00 2001 From: nilaoda Date: Thu, 15 Jun 2023 17:58:54 +0800 Subject: [PATCH] Fix #123 --- .../DownloadManager/SimpleDownloadManager.cs | 13 ++++++++----- .../DownloadManager/SimpleLiveRecordManager2.cs | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs b/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs index 6028329..760148a 100644 --- a/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs +++ b/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs @@ -698,12 +698,15 @@ namespace N_m3u8DL_RE.DownloadManager if (DownloaderConfig.MyOptions.UseMkvmerge) result = MergeUtil.MuxInputsByMkvmerge(DownloaderConfig.MyOptions.MkvmergeBinaryPath!, OutputFiles.ToArray(), outPath); else result = MergeUtil.MuxInputsByFFmpeg(DownloaderConfig.MyOptions.FFmpegBinaryPath!, OutputFiles.ToArray(), outPath, DownloaderConfig.MyOptions.MuxToMp4, !DownloaderConfig.MyOptions.NoDateInfo); //完成后删除各轨道文件 - if (result && !DownloaderConfig.MyOptions.MuxKeepFiles) + if (result) { - Logger.WarnMarkUp("[grey]Cleaning files...[/]"); - OutputFiles.ForEach(f => File.Delete(f.FilePath)); - var tmpDir = DownloaderConfig.MyOptions.TmpDir ?? Environment.CurrentDirectory; - OtherUtil.SafeDeleteDir(tmpDir); + if (!DownloaderConfig.MyOptions.MuxKeepFiles) + { + Logger.WarnMarkUp("[grey]Cleaning files...[/]"); + OutputFiles.ForEach(f => File.Delete(f.FilePath)); + var tmpDir = DownloaderConfig.MyOptions.TmpDir ?? Environment.CurrentDirectory; + OtherUtil.SafeDeleteDir(tmpDir); + } } else { diff --git a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs index 7b7dc3b..5c2b59c 100644 --- a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs +++ b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs @@ -888,12 +888,15 @@ namespace N_m3u8DL_RE.DownloadManager if (DownloaderConfig.MyOptions.UseMkvmerge) result = MergeUtil.MuxInputsByMkvmerge(DownloaderConfig.MyOptions.MkvmergeBinaryPath!, OutputFiles.ToArray(), outPath); else result = MergeUtil.MuxInputsByFFmpeg(DownloaderConfig.MyOptions.FFmpegBinaryPath!, OutputFiles.ToArray(), outPath, DownloaderConfig.MyOptions.MuxToMp4, !DownloaderConfig.MyOptions.NoDateInfo); //完成后删除各轨道文件 - if (result && !DownloaderConfig.MyOptions.MuxKeepFiles) + if (result) { - Logger.WarnMarkUp("[grey]Cleaning files...[/]"); - OutputFiles.ForEach(f => File.Delete(f.FilePath)); - var tmpDir = DownloaderConfig.MyOptions.TmpDir ?? Environment.CurrentDirectory; - OtherUtil.SafeDeleteDir(tmpDir); + if (!DownloaderConfig.MyOptions.MuxKeepFiles) + { + Logger.WarnMarkUp("[grey]Cleaning files...[/]"); + OutputFiles.ForEach(f => File.Delete(f.FilePath)); + var tmpDir = DownloaderConfig.MyOptions.TmpDir ?? Environment.CurrentDirectory; + OtherUtil.SafeDeleteDir(tmpDir); + } } else {