From d080f8e84702935e233ced09dba31b27a758e914 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 30 May 2023 01:09:01 -0700 Subject: fix(chapter_selection): start chapter index at one --- src/lib/chapter_selection.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib/chapter_selection.sh b/src/lib/chapter_selection.sh index c3534a5..1ab75d1 100644 --- a/src/lib/chapter_selection.sh +++ b/src/lib/chapter_selection.sh @@ -1,7 +1,7 @@ chapter_selection() { # Novel page HTML novel_page="$(gum spin --spinner line --show-output -- \ - curl --silent --get --data-urlencode "k=${args[title]}" "${1}")" + curl --silent --get --data-urlencode "k=${args[title]}" "${1}")" # Chapter data IFS=$'\n' read -r -d '\n' -a chapter_locations <<<"$(echo "${novel_page}" | @@ -14,7 +14,7 @@ chapter_selection() { # Fix output format for Gum for ((i = 0; i < "${#chapter_locations[@]}"; i++)); do - chapters+="$(printf "\nChapter ${i}:%s" "${chapter_names[${i}]}")" + chapters+="$(printf "\nChapter $((i + 1)):%s" "${chapter_names[${i}]}")" done # Remove leading new-line -- cgit v1.2.3