混流后若临时文件夹空则删除
This commit is contained in:
parent
f7d20c3dfb
commit
b13027a758
|
@ -564,11 +564,21 @@ namespace N_m3u8DL_RE.DownloadManager
|
||||||
//混流
|
//混流
|
||||||
if (success && OutputFiles.Count > 0)
|
if (success && OutputFiles.Count > 0)
|
||||||
{
|
{
|
||||||
|
var saveDir = DownloaderConfig.SaveDir ?? Environment.CurrentDirectory;
|
||||||
var outName = $"{DownloaderConfig.SaveName ?? NowDateTime.ToString("yyyy-MM-dd_HH-mm-ss")}";
|
var outName = $"{DownloaderConfig.SaveName ?? NowDateTime.ToString("yyyy-MM-dd_HH-mm-ss")}";
|
||||||
|
var outPath = Path.Combine(saveDir, outName);
|
||||||
Logger.WarnMarkUp($"Muxing to [grey]{outName.EscapeMarkup()}.mkv[/]");
|
Logger.WarnMarkUp($"Muxing to [grey]{outName.EscapeMarkup()}.mkv[/]");
|
||||||
var result = MergeUtil.MuxInputsByFFmpeg(DownloaderConfig.FFmpegBinaryPath!, OutputFiles.ToArray(), outName);
|
var result = MergeUtil.MuxInputsByFFmpeg(DownloaderConfig.FFmpegBinaryPath!, OutputFiles.ToArray(), outPath);
|
||||||
//完成后删除各轨道文件
|
//完成后删除各轨道文件
|
||||||
if (result) OutputFiles.ForEach(f => File.Delete(f.FilePath));
|
if (result)
|
||||||
|
{
|
||||||
|
OutputFiles.ForEach(f => File.Delete(f.FilePath));
|
||||||
|
var tmpDir = DownloaderConfig.TmpDir ?? Environment.CurrentDirectory;
|
||||||
|
if (!Directory.EnumerateFiles(tmpDir).Any())
|
||||||
|
{
|
||||||
|
Directory.Delete(tmpDir);
|
||||||
|
}
|
||||||
|
}
|
||||||
else Logger.ErrorMarkUp($"Mux failed");
|
else Logger.ErrorMarkUp($"Mux failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue