[import_track] Rewrote metadata parsing for eval is unreliable

This commit is contained in:
ayakael 2018-05-18 18:24:56 -07:00
parent f7bf75f6ec
commit 4c5fbe16a3
No known key found for this signature in database
GPG key ID: 575626A4AE5F4026

View file

@ -25,10 +25,10 @@ import_track() {
local coverList=($(find "${DIR_NAME}" -maxdepth 1 \( -name '*.jpg' -o -name '*.png' \) -printf '%p\t'))
# Metadata parsing
local metadataList=($(print_meta_flac ${TRACK} | sed 's|;| |g' ))
for metadata in ${metadataList[@]}; do
eval local ${metadata}
done
local ARTIST=$(cut -d= -f2 <<< $(print_meta_flac ${TRACK} ARTIST))
local ALBUM=$(cut -d= -f2 <<< $(print_meta_flac ${TRACK} ALBUM))
local DISCNUMBER=$(cut -d= -f2 <<< $(print_meta_flac ${TRACK} DISCNUMBER))
local TRACKNUMBER=$(cut -d= -f2 <<< $(print_meta_flac ${TRACK} TRACKNUMBER))
# Setting TRACK_DIR
[[ -z "${DISCNUMBER}" ]] && local DISCNUMBER=1