From 048e15a476c81479be85671283e7ee77be568ab1 Mon Sep 17 00:00:00 2001 From: Ben Saufley Date: Wed, 12 Jan 2022 00:12:20 -0500 Subject: [PATCH 1/2] Use GREP variable everywhere --- AAXtoMP3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AAXtoMP3 b/AAXtoMP3 index 2a88bd1..bd2c94b 100755 --- a/AAXtoMP3 +++ b/AAXtoMP3 @@ -555,7 +555,7 @@ CHAPTER\((.key))NAME=\(.value.title)"' "${extra_chapter_file}" > "${tmp_chapter_ if [[ "${library_file_exists}" == 1 ]]; then asin=$(jq -r '.content_metadata.content_reference.asin' "${extra_chapter_file}") if [[ ! -z "${asin}" ]]; then - lib_entry=$(grep "^${asin}" "${library_file}") + lib_entry=$($GREP "^${asin}" "${library_file}") if [[ ! -z "${lib_entry}" ]]; then series_title=$(echo "${lib_entry}" | awk -F '\t' '{print $6}') series_sequence=$(echo "${lib_entry}" | awk -F '\t' '{print $7}') @@ -800,7 +800,7 @@ do fi extra_crop_cover='' - cover_width=$(ffprobe -i "${cover_file}" 2>&1 | grep -Po "[0-9]+(?=x[0-9]+)") + cover_width=$(ffprobe -i "${cover_file}" 2>&1 | $GREP -Po "[0-9]+(?=x[0-9]+)") if (( ${cover_width} % 2 == 1 )); then if [ "$((${loglevel} > 1))" == "1" ]; then log "Cover ${cover_file} has odd width ${cover_width}, setting extra_crop_cover to make even." From 20289a17741d6eebe73be8eda73424d1516bb0c0 Mon Sep 17 00:00:00 2001 From: Ben Saufley Date: Wed, 12 Jan 2022 00:28:52 -0500 Subject: [PATCH 2/2] One sed/gsed as well --- AAXtoMP3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AAXtoMP3 b/AAXtoMP3 index bd2c94b..7e0f55c 100755 --- a/AAXtoMP3 +++ b/AAXtoMP3 @@ -559,7 +559,7 @@ CHAPTER\((.key))NAME=\(.value.title)"' "${extra_chapter_file}" > "${tmp_chapter_ if [[ ! -z "${lib_entry}" ]]; then series_title=$(echo "${lib_entry}" | awk -F '\t' '{print $6}') series_sequence=$(echo "${lib_entry}" | awk -F '\t' '{print $7}') - sed -i "/^ Metadata:/a\\ + $SED -i "/^ Metadata:/a\\ series : ${series_title}\\ series_sequence : ${series_sequence}" "${metadata_file}" fi