mirror of
https://github.com/KrumpetPirate/AAXtoMP3.git
synced 2024-11-18 03:08:57 +01:00
Merge pull request #61 from reidar-cederqvist/master
AAXtoMP3: fix how .authcode is located fix issue #60
This commit is contained in:
commit
2f8bb35b68
21
AAXtoMP3
21
AAXtoMP3
@ -55,18 +55,19 @@ auth_code="";
|
|||||||
for dir in $authcodeDirs; do
|
for dir in $authcodeDirs; do
|
||||||
codeFile="${dir}$authcode";
|
codeFile="${dir}$authcode";
|
||||||
|
|
||||||
if [ ! -f "$codeFile" ]; then
|
if [ ! -f "$codeFile" -o ! -s "$codeFile" ]; then
|
||||||
auth_code=$1
|
codeFile=""
|
||||||
shift
|
echo "INFO: Sorry, missing or empty \"$codeFile\" found, skipping.";
|
||||||
break;
|
|
||||||
elif [ -s "$codeFile" ]; then
|
|
||||||
auth_code=`head -1 "$codeFile"`
|
|
||||||
break;
|
|
||||||
else
|
|
||||||
echo "INFO: Sorry, empty \"$codeFile\" found, skipping.";
|
|
||||||
fi;
|
fi;
|
||||||
done;
|
done;
|
||||||
|
|
||||||
|
if [ ! -f "$codeFile" ]; then
|
||||||
|
auth_code=$1
|
||||||
|
shift
|
||||||
|
else
|
||||||
|
auth_code=`head -1 "$codeFile"`
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$auth_code" ]; then
|
if [ -z "$auth_code" ]; then
|
||||||
echo "INFO: Sorry, no authcode provided.";
|
echo "INFO: Sorry, no authcode provided.";
|
||||||
exit 1;
|
exit 1;
|
||||||
@ -107,7 +108,7 @@ do
|
|||||||
save_metadata "${path}"
|
save_metadata "${path}"
|
||||||
genre=$(get_metadata_value genre)
|
genre=$(get_metadata_value genre)
|
||||||
artist=$(get_metadata_value artist)
|
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}"
|
output_directory="$(dirname "${path}")/${genre}/${artist}/${title}"
|
||||||
mkdir -p "${output_directory}"
|
mkdir -p "${output_directory}"
|
||||||
full_file_path="${output_directory}/${title}.${extension}"
|
full_file_path="${output_directory}/${title}.${extension}"
|
||||||
|
Loading…
Reference in New Issue
Block a user