mirror of
https://github.com/NohamR/N_m3u8DL-RE.git
synced 2025-05-25 14:51:52 +00:00
当流类型被更改时,字典中的键也应当同步更新
This commit is contained in:
parent
9ad3b9edb1
commit
2bff0132d0
@ -433,7 +433,7 @@ namespace N_m3u8DL_RE.CommandLine
|
|||||||
Environment.Exit(0);
|
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,
|
Input, TmpDir, SaveDir, SaveName, BaseUrl, ThreadCount, DownloadRetryCount, AutoSelect, SkipMerge, SkipDownload, CheckSegmentsCount,
|
||||||
BinaryMerge, DelAfterDone, WriteMetaJson, AppendUrlParams, ConcurrentDownload, Headers, /**SavePattern,**/ SubOnly, SubtitleFormat, AutoSubtitleFix,
|
BinaryMerge, DelAfterDone, WriteMetaJson, AppendUrlParams, ConcurrentDownload, Headers, /**SavePattern,**/ SubOnly, SubtitleFormat, AutoSubtitleFix,
|
||||||
|
@ -129,11 +129,28 @@ namespace N_m3u8DL_RE.DownloadManager
|
|||||||
|
|
||||||
if (mediainfos.All(m => m.Type == "Audio"))
|
if (mediainfos.All(m => m.Type == "Audio"))
|
||||||
{
|
{
|
||||||
|
var lastKey = streamSpec.ToShortString();
|
||||||
streamSpec.MediaType = MediaType.AUDIO;
|
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"))
|
else if (mediainfos.All(m => m.Type == "Subtitle"))
|
||||||
{
|
{
|
||||||
|
var lastKey = streamSpec.ToShortString();
|
||||||
streamSpec.MediaType = MediaType.SUBTITLES;
|
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")
|
if (streamSpec.Extension == null || streamSpec.Extension == "ts")
|
||||||
streamSpec.Extension = "vtt";
|
streamSpec.Extension = "vtt";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user