From f94cf1baa77746c18e32ec28d06094f33b04abe5 Mon Sep 17 00:00:00 2001 From: fabh2o Date: Fri, 5 Feb 2021 16:53:43 +0100 Subject: [PATCH] fix for find command: use basename --- AAXtoMP3 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/AAXtoMP3 b/AAXtoMP3 index 20ebe6d..9193b26 100755 --- a/AAXtoMP3 +++ b/AAXtoMP3 @@ -371,13 +371,14 @@ validate_extra_files() { # Cover extra_dirname="$(dirname "${extra_media_file}")" - extra_find_command='find "${extra_dirname}" -maxdepth 1 -regex ".*/${extra_title}_([0-9]+)\.jpg"' + extra_find_command='find "${extra_dirname}" -maxdepth 1 -regex ".*/${extra_title##*/}_([0-9]+)\.jpg"' # We want the output of the find command, we will turn errexit on later set +e errexit extra_cover_file="$(eval ${extra_find_command})" + extra_eval_comm="$(eval echo ${extra_find_command})" set -e errexit - debug_vars "Audible-cli variables" extra_media_file extra_title extra_chapter_file extra_cover_file extra_find_command extra_dirname + debug_vars "Audible-cli variables" extra_media_file extra_title extra_chapter_file extra_cover_file extra_find_command extra_eval_comm extra_dirname # Test for chapter file existence if [[ ! -r "${extra_chapter_file}" ]] ; then