From 21886d74c7315b0d61f920306937fdf0c3320f26 Mon Sep 17 00:00:00 2001 From: nilaoda Date: Sun, 10 Jul 2022 03:12:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=89=E6=8B=A9=E5=AF=B9?= =?UTF-8?q?=E8=AF=9D=E6=A1=86=E9=BB=98=E8=AE=A4=E9=80=89=E4=B8=AD=E9=A1=B9?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/N_m3u8DL-RE.Parser/Util/PromptUtil.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/N_m3u8DL-RE.Parser/Util/PromptUtil.cs b/src/N_m3u8DL-RE.Parser/Util/PromptUtil.cs index 4755bcd..b00c58b 100644 --- a/src/N_m3u8DL-RE.Parser/Util/PromptUtil.cs +++ b/src/N_m3u8DL-RE.Parser/Util/PromptUtil.cs @@ -37,12 +37,17 @@ namespace N_m3u8DL_RE.Parser.Util .PageSize(10) .MoreChoicesText(ResString.promptChoiceText) .InstructionsText(ResString.promptInfo) - .AddChoiceGroup(new StreamSpec() { Name = "__Basic" }, basicStreams); + ; //默认选中第一个 var first = lists.First(); prompt.Select(first); + if (basicStreams.Any()) + { + prompt.AddChoiceGroup(new StreamSpec() { Name = "__Basic" }, basicStreams); + } + if (audios.Any()) { prompt.AddChoiceGroup(new StreamSpec() { Name = "__Audio" }, audios); @@ -61,6 +66,10 @@ namespace N_m3u8DL_RE.Parser.Util prompt.Select(subs.First(s => s.GroupId == first.SubtitleId)); } } + + //如果此时还是没有选中任何流,自动选择一个 + prompt.Select(basicStreams.Concat(audios).Concat(subs).First()); + //多选 var selectedStreams = AnsiConsole.Prompt(prompt);