[gen_image] Can now define output file instead of output folder

This commit is contained in:
ayakael 2018-07-12 16:15:32 -08:00
parent 4899def695
commit 8ecab1852f
No known key found for this signature in database
GPG key ID: 575626A4AE5F4026

View file

@ -6,14 +6,15 @@
# gen_image - Generates image from list of lossless audio files
#
# USAGE
# gen_image </path/to/output/dir> <file_1> [<file_1>] [<...>]
# gen_image </path/to/output/file> <file_1> [<file_2>] [<...>]
#
# DEPENDENCIES src/med_convert
#
# }
gen_image() {
local TARGET_DIR="${1}"; shift
local TARGET="${1}"; shift
local TARGET_DIR=$(dirname "${TARGET}")
local fileList=("${@}")
if [[ ${#fileList[@]} -eq 1 ]]; then
cat ${fileList[@]} > joined.flac
@ -31,6 +32,7 @@ gen_image() {
fi
fi
metaflac --remove-all --dont-use-padding "${TARGET_DIR}/joined.flac"
mv "${TARGET_DIR}/joined.flac" "${TARGET}"
return 0
}