transcode : skip existing files.
This commit is contained in:
parent
82548f6214
commit
c9e9003b12
|
@ -95,8 +95,6 @@ checksum_check()
|
||||||
echo -e "${color_bred}Failed: ${failed}.${color_default}"
|
echo -e "${color_bred}Failed: ${failed}.${color_default}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ ${total} = 0 ]] && return 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
checksum()
|
checksum()
|
||||||
|
|
|
@ -8,6 +8,7 @@ transcode()
|
||||||
local total=${#targets[@]}
|
local total=${#targets[@]}
|
||||||
local count=0
|
local count=0
|
||||||
local failed=0
|
local failed=0
|
||||||
|
local skipped=0
|
||||||
|
|
||||||
# Report no format.
|
# Report no format.
|
||||||
if [[ "${format}" = "" ]]; then
|
if [[ "${format}" = "" ]]; then
|
||||||
|
@ -37,8 +38,8 @@ transcode()
|
||||||
# Show status.
|
# Show status.
|
||||||
echo -e "${status}"
|
echo -e "${status}"
|
||||||
|
|
||||||
# Skip same format.
|
# Skip if file exists.
|
||||||
# [[ "${from}" = "${to}" ]] && continue
|
[[ -f "${output}" ]] && { ((skipped++)); continue; }
|
||||||
|
|
||||||
# Support multiple inputs.
|
# Support multiple inputs.
|
||||||
[[ "${to}" = "mp3" ]] && from=""
|
[[ "${to}" = "mp3" ]] && from=""
|
||||||
|
@ -78,6 +79,11 @@ transcode()
|
||||||
((failed++))
|
((failed++))
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ ${skipped} != 0 ]]; then
|
||||||
|
echo -e "${color_byellow}Skipped: ${skipped}.${color_default}"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ${failed} != 0 ]]; then
|
if [[ ${failed} != 0 ]]; then
|
||||||
echo -e "${color_bred}Failed: ${failed}.${color_default}"
|
echo -e "${color_bred}Failed: ${failed}.${color_default}"
|
||||||
|
|
Reference in a new issue