tc-audio-transcode: fixed missing FILENAME variable
parent
000a2819bd
commit
b22f18ff3f
|
@ -85,7 +85,7 @@ Tags:
|
||||||
|
|
||||||
You can use the following variables to refer to existing values:
|
You can use the following variables to refer to existing values:
|
||||||
\$ALBUM
|
\$ALBUM
|
||||||
\$ALBUM_ARTIST
|
\$ALBUMARTIST
|
||||||
\$ARTIST
|
\$ARTIST
|
||||||
\$COMPOSER
|
\$COMPOSER
|
||||||
\$DATE
|
\$DATE
|
||||||
|
@ -108,6 +108,9 @@ Examples:
|
||||||
Set 'artist' to be 'composer', and 'title' to be preceded by 'artist', do not reencode:
|
Set 'artist' to be 'composer', and 'title' to be preceded by 'artist', do not reencode:
|
||||||
${1##*/} -s -a '\$COMPOSER' -t '\$ARTIST - \$TITLE' file.ogg
|
${1##*/} -s -a '\$COMPOSER' -t '\$ARTIST - \$TITLE' file.ogg
|
||||||
|
|
||||||
|
Set track number to first field in file name:
|
||||||
|
${1##*/} -n '${FILENAME%% }'
|
||||||
|
|
||||||
IMPORTANT: you *must* use single quotes when using variables. Also note that the
|
IMPORTANT: you *must* use single quotes when using variables. Also note that the
|
||||||
string parameters are all evaluated using 'eval', which means that some
|
string parameters are all evaluated using 'eval', which means that some
|
||||||
characters may need escaping with '\'. Since parenthesis '()' are often used, a
|
characters may need escaping with '\'. Since parenthesis '()' are often used, a
|
||||||
|
@ -228,7 +231,7 @@ _metadata_filter()
|
||||||
INPUT_TITLE=$(_metadata_filter "title")
|
INPUT_TITLE=$(_metadata_filter "title")
|
||||||
INPUT_ARTIST=$(_metadata_filter "artist")
|
INPUT_ARTIST=$(_metadata_filter "artist")
|
||||||
INPUT_ALBUM=$(_metadata_filter "album")
|
INPUT_ALBUM=$(_metadata_filter "album")
|
||||||
INPUT_ALBUM_ARTIST=$(_metadata_filter "album_artist")
|
INPUT_ALBUMARTIST=$(_metadata_filter "album_artist")
|
||||||
INPUT_COMPOSER=$(_metadata_filter "composer")
|
INPUT_COMPOSER=$(_metadata_filter "composer")
|
||||||
INPUT_DISC=$(_metadata_filter "disc")
|
INPUT_DISC=$(_metadata_filter "disc")
|
||||||
INPUT_GENRE=$(_metadata_filter "genre")
|
INPUT_GENRE=$(_metadata_filter "genre")
|
||||||
|
@ -254,13 +257,15 @@ _string_cleanser()
|
||||||
TITLE=$(_string_cleanser "$INPUT_TITLE")
|
TITLE=$(_string_cleanser "$INPUT_TITLE")
|
||||||
ARTIST=$(_string_cleanser "$INPUT_ARTIST")
|
ARTIST=$(_string_cleanser "$INPUT_ARTIST")
|
||||||
ALBUM=$(_string_cleanser "$INPUT_ALBUM")
|
ALBUM=$(_string_cleanser "$INPUT_ALBUM")
|
||||||
|
ALBUMARTIST=$(_string_cleanser "$INPUT_ALBUMARTIST")
|
||||||
COMPOSER=$(_string_cleanser "$INPUT_COMPOSER")
|
COMPOSER=$(_string_cleanser "$INPUT_COMPOSER")
|
||||||
DISC=$(_string_cleanser "$INPUT_DISC")
|
DISC=$(_string_cleanser "$INPUT_DISC")
|
||||||
GENRE=$(_string_cleanser "$INPUT_GENRE")
|
GENRE=$(_string_cleanser "$INPUT_GENRE")
|
||||||
TRACK=$(_string_cleanser "$INPUT_TRACK")
|
TRACK=$(_string_cleanser "$INPUT_TRACK")
|
||||||
DATE=$(_string_cleanser "$INPUT_DATE")
|
DATE=$(_string_cleanser "$INPUT_DATE")
|
||||||
TYER=$(_string_cleanser "$INPUT_TYER")
|
TYER=$(_string_cleanser "$INPUT_TYER")
|
||||||
ALBUM_ARTIST=$(_string_cleanser "$INPUT_ALBUM_ARTIST")
|
|
||||||
|
FILENAME=$(_string_cleanser "$INPUT_FILE")
|
||||||
|
|
||||||
##================================================================================
|
##================================================================================
|
||||||
## OUTPUT variables.
|
## OUTPUT variables.
|
||||||
|
@ -271,7 +276,7 @@ OUTPUT_TITLE=$(eval echo $(echo ${OUTPUT_TITLE:-Unknown Title} | sed 's/[()]/\\&
|
||||||
OUTPUT_ALBUM=$(eval echo $(echo ${OUTPUT_ALBUM:-Unknown Album} | sed 's/[()]/\\&/g'))
|
OUTPUT_ALBUM=$(eval echo $(echo ${OUTPUT_ALBUM:-Unknown Album} | sed 's/[()]/\\&/g'))
|
||||||
|
|
||||||
## We use album artist if artist is empty.
|
## We use album artist if artist is empty.
|
||||||
[ -z "$OUTPUT_ARTIST" ] && [ -n "$ALBUM_ARTIST" ] && OUTPUT_ARTIST="$ALBUM_ARTIST"
|
[ -z "$OUTPUT_ARTIST" ] && [ -n "$ALBUMARTIST" ] && OUTPUT_ARTIST="$ALBUMARTIST"
|
||||||
OUTPUT_ARTIST=$(eval echo $(echo ${OUTPUT_ARTIST:-Unknown Artist} | sed 's/[()]/\\&/g'))
|
OUTPUT_ARTIST=$(eval echo $(echo ${OUTPUT_ARTIST:-Unknown Artist} | sed 's/[()]/\\&/g'))
|
||||||
|
|
||||||
## If OUTPUT_GENRE is set from command-line parameters, we use the
|
## If OUTPUT_GENRE is set from command-line parameters, we use the
|
||||||
|
|
Loading…
Reference in New Issue