From 5adceb760812f7d5cb61530bf7a9d4f5aa6542e3 Mon Sep 17 00:00:00 2001 From: glax <--local> Date: Thu, 18 May 2023 18:21:21 +0200 Subject: [PATCH] Changed enumeration of chapters to include names --- Tranga-CLI/Program.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tranga-CLI/Program.cs b/Tranga-CLI/Program.cs index 84865f3..6b606b5 100644 --- a/Tranga-CLI/Program.cs +++ b/Tranga-CLI/Program.cs @@ -26,7 +26,11 @@ public class Program int cIndex = 0; foreach (Chapter ch in chapters) { - string name = ch.name is not null && ch.name.Length > 0 ? ch.name : cIndex.ToString(); + string name = cIndex.ToString(); + if (ch.name is not null && ch.name.Length > 0) + name = ch.name; + else if (ch.chapterNumber is not null && ch.chapterNumber.Length > 0) + name = ch.chapterNumber; Console.WriteLine($"{cIndex++}: {name}"); } Console.WriteLine($"Select Chapters to download (0-{chapters.Length - 1}) [range x-y or 'a' for all]: ");