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);