From 2bff0132d011b6878e1a79b35e46aa50eca69406 Mon Sep 17 00:00:00 2001 From: nilaoda Date: Sun, 23 Oct 2022 21:12:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E6=B5=81=E7=B1=BB=E5=9E=8B=E8=A2=AB?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=97=B6=EF=BC=8C=E5=AD=97=E5=85=B8=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E9=94=AE=E4=B9=9F=E5=BA=94=E5=BD=93=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs | 2 +- .../DownloadManager/SimpleLiveRecordManager2.cs | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs b/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs index 3cee7f0..dad5a0c 100644 --- a/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs +++ b/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs @@ -433,7 +433,7 @@ namespace N_m3u8DL_RE.CommandLine Environment.Exit(0); } - var rootCommand = new RootCommand("N_m3u8DL-RE (Beta version) 20221017") + var rootCommand = new RootCommand("N_m3u8DL-RE (Beta version) 20221023") { Input, TmpDir, SaveDir, SaveName, BaseUrl, ThreadCount, DownloadRetryCount, AutoSelect, SkipMerge, SkipDownload, CheckSegmentsCount, BinaryMerge, DelAfterDone, WriteMetaJson, AppendUrlParams, ConcurrentDownload, Headers, /**SavePattern,**/ SubOnly, SubtitleFormat, AutoSubtitleFix, diff --git a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs index 8ff7360..c6bee1f 100644 --- a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs +++ b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs @@ -129,11 +129,28 @@ namespace N_m3u8DL_RE.DownloadManager if (mediainfos.All(m => m.Type == "Audio")) { + var lastKey = streamSpec.ToShortString(); streamSpec.MediaType = MediaType.AUDIO; + var newKey = streamSpec.ToShortString(); + + //需要同步修改Dictionary中的Key + if (LastFileNameDic.Remove(lastKey, out var lastValue1)) + LastFileNameDic[newKey] = lastValue1!; + if (DateTimeDic.Remove(lastKey, out var lastValue2)) + DateTimeDic[newKey] = lastValue2; } else if (mediainfos.All(m => m.Type == "Subtitle")) { + var lastKey = streamSpec.ToShortString(); streamSpec.MediaType = MediaType.SUBTITLES; + var newKey = streamSpec.ToShortString(); + + //需要同步修改Dictionary中的Key + if (LastFileNameDic.Remove(lastKey, out var lastValue1)) + LastFileNameDic[newKey] = lastValue1!; + if (DateTimeDic.Remove(lastKey, out var lastValue2)) + DateTimeDic[newKey] = lastValue2; + if (streamSpec.Extension == null || streamSpec.Extension == "ts") streamSpec.Extension = "vtt"; }