From 473c0d2525d5b5759a204a99218eb7e9e6c47b05 Mon Sep 17 00:00:00 2001 From: Jaime Date: Fri, 29 May 2020 10:24:55 -0700 Subject: [PATCH] adds 2 digits for last track for cases when less than 10 tracks --- .local/bin/booksplit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/booksplit b/.local/bin/booksplit index 0029d0bc..3d0ab075 100755 --- a/.local/bin/booksplit +++ b/.local/bin/booksplit @@ -39,6 +39,6 @@ do done < "$2" # The last track must be done outside the loop. echo "From $start to the end: $title" -file="$escbook/$track-$esctitle.$ext" +file="$escbook/$(printf "%.2d" "$track")-$esctitle.$ext" echo "Splitting \"$title\"..." && ffmpeg -nostdin -y -loglevel -8 -i "$inputaudio" -ss "$start" -vn "$file" && echo "Tagging \"$title\"..." && tag -a "$author" -A "$booktitle" -t "$title" -n "$track" -N "$total" -d "$year" "$file"