~voidraven/mp3me

88f690ed855dca3eb5a17c5a58ba06325d66ce43 — lotus 1 year, 1 month ago 7a799ca
fixed nested directory bug
1 files changed, 10 insertions(+), 6 deletions(-)

M mp3me.sh
M mp3me.sh => mp3me.sh +10 -6
@@ 21,13 21,17 @@ SHIFT=0
# check if the file provided is a has a valid music extension
# cuts off extension and compares it
fun_is_music () {
    L_FILE=$1
    L_FILE_EXT=$(echo "${L_FILE##*.}")
    if [ $L_FILE_EXT = "flac" ] || [ $L_FILE_EXT = "aac" ] || [ $L_FILE_EXT = "ogg" ] || [ $L_FILE_EXT = "wav" ] || [ $L_FILE_EXT = "m4a" ] ; then
	unset L_FILE L_FILE_EXT
	return 0    
    L_FILE="$1"
    # ignore directories
    if [ -f "$L_FILE" ] ; then
	L_FILE_EXT=$(echo "${L_FILE##*.}")
	if [ $L_FILE_EXT = "flac" ] || [ $L_FILE_EXT = "aac" ] || [ $L_FILE_EXT = "ogg" ] || [ $L_FILE_EXT = "wav" ] || [ $L_FILE_EXT = "m4a" ] ; then
	    unset L_FILE L_FILE_EXT
	    return 0    
	fi
	unset L_FILE_EXT
    fi
    unset L_FILE L_FILE_EXT
    unset L_FILE 
    return 1
}