From db48c6a9706a51684a5c4eb2142c086acb94334f Mon Sep 17 00:00:00 2001 From: Reidar Cederqvist Date: Thu, 7 Jun 2018 09:11:47 +0200 Subject: [PATCH 1/2] AAXtoMP3: fix how .authcode is located fix issue #60 --- AAXtoMP3 | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/AAXtoMP3 b/AAXtoMP3 index 3fa4de7..0cfabc1 100755 --- a/AAXtoMP3 +++ b/AAXtoMP3 @@ -55,18 +55,19 @@ auth_code=""; for dir in $authcodeDirs; do codeFile="${dir}$authcode"; - if [ ! -f "$codeFile" ]; then - auth_code=$1 - shift - break; - elif [ -s "$codeFile" ]; then - auth_code=`head -1 "$codeFile"` - break; - else - echo "INFO: Sorry, empty \"$codeFile\" found, skipping."; + if [ ! -f "$codeFile" -o ! -s "$codeFile" ]; then + codeFile="" + echo "INFO: Sorry, missing or empty \"$codeFile\" found, skipping."; fi; done; +if [ ! -f "$codeFile" ]; then + auth_code=$1 + shift +else + auth_code=`head -1 "$codeFile"` +fi + if [ -z "$auth_code" ]; then echo "INFO: Sorry, no authcode provided."; exit 1; From 8ebd16ae8b4ce6ea45fde0665b477d1397edb6a4 Mon Sep 17 00:00:00 2001 From: Reidar Cederqvist Date: Thu, 7 Jun 2018 09:26:38 +0200 Subject: [PATCH 2/2] AAXtoMP3: fix possition of dash when replacing colon --- AAXtoMP3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AAXtoMP3 b/AAXtoMP3 index 0cfabc1..2e81a84 100755 --- a/AAXtoMP3 +++ b/AAXtoMP3 @@ -108,7 +108,7 @@ do save_metadata "${path}" genre=$(get_metadata_value genre) artist=$(get_metadata_value artist) - title=$(get_metadata_value title | sed 's/'\:'/'-\ '/g' | xargs -0) + title=$(get_metadata_value title | sed 's/'\:'/'\ -'/g' | xargs -0) output_directory="$(dirname "${path}")/${genre}/${artist}/${title}" mkdir -p "${output_directory}" full_file_path="${output_directory}/${title}.${extension}"