mirror of
https://github.com/KrumpetPirate/AAXtoMP3.git
synced 2024-11-18 03:08:57 +01:00
fix tmp_chapter_file: unbound variable
This commit is contained in:
parent
f1c4b97bc1
commit
bf1f384341
12
AAXtoMP3
12
AAXtoMP3
@ -394,13 +394,6 @@ trap 'rm -r -f "${working_directory}"' EXIT
|
|||||||
# Set up some basic working files ASAP. Note the trap will clean this up no matter what.
|
# Set up some basic working files ASAP. Note the trap will clean this up no matter what.
|
||||||
working_directory=`mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir'`
|
working_directory=`mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir'`
|
||||||
metadata_file="${working_directory}/metadata.txt"
|
metadata_file="${working_directory}/metadata.txt"
|
||||||
# Creating a temp file to store the chapter data collected in save_metadata, as the output
|
|
||||||
# folder will only be defined after save_metadata has been executed.
|
|
||||||
# This file is only required when using audible-cli data and executing in single mode to
|
|
||||||
# get proper chapter titles in single file m4b output.
|
|
||||||
if [[ "${audibleCli}" == "1" && "${mode}" == "single" ]] ; then
|
|
||||||
tmp_chapter_file="${working_directory}/chapter.txt"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# -----
|
# -----
|
||||||
# Validate the AAX and extract the metadata associated with the file.
|
# Validate the AAX and extract the metadata associated with the file.
|
||||||
@ -534,6 +527,11 @@ save_metadata() {
|
|||||||
# chapter titles from the .json generated by audible–cli and store
|
# chapter titles from the .json generated by audible–cli and store
|
||||||
# them correctly formatted for mp4chaps in a chapter.txt
|
# them correctly formatted for mp4chaps in a chapter.txt
|
||||||
if [ "${mode}" == "single" ]; then
|
if [ "${mode}" == "single" ]; then
|
||||||
|
# Creating a temp file to store the chapter data collected in save_metadata, as the output
|
||||||
|
# folder will only be defined after save_metadata has been executed.
|
||||||
|
# This file is only required when using audible-cli data and executing in single mode to
|
||||||
|
# get proper chapter titles in single file m4b output.
|
||||||
|
tmp_chapter_file="${working_directory}/chapter.txt"
|
||||||
jq -r \
|
jq -r \
|
||||||
'def pad(n): tostring | if (n > length) then ((n - length) * "0") + . else . end;
|
'def pad(n): tostring | if (n > length) then ((n - length) * "0") + . else . end;
|
||||||
.content_metadata.chapter_info.chapters |
|
.content_metadata.chapter_info.chapters |
|
||||||
|
Loading…
Reference in New Issue
Block a user