[print_meta_cue] Rewrote again
This commit is contained in:
parent
12232b88d6
commit
78fb4db482
1 changed files with 16 additions and 6 deletions
|
@ -17,16 +17,26 @@ print_meta_cue() {
|
||||||
local trackmetaList=($( sed -n '/TRACK 01/,$p' ${CUE} | tr -d '\n' | awk 'BEGIN {RS="TRACK"}{print $0}' | tail -n +2))
|
local trackmetaList=($( sed -n '/TRACK 01/,$p' ${CUE} | tr -d '\n' | awk 'BEGIN {RS="TRACK"}{print $0}' | tail -n +2))
|
||||||
|
|
||||||
# [Output] variable generator
|
# [Output] variable generator
|
||||||
echo -n "DISCID=$(sed 's|\ \ .*||' "${CUE}" | grep -a "REM DISCID" | sed 's|REM DISCID ||');"
|
local DISCID=$(sed 's|\ \ .*||' "${CUE}" | grep -a "REM DISCID" | sed 's|REM DISCID ||')
|
||||||
echo -n "ARTIST=$(sed 's|\ \ .*||' "${CUE}" | grep -a "PERFORMER" | sed 's|PERFORMER ||' | sed 's|\"||g');"
|
local ARTIST=$(sed 's|\ \ .*||' "${CUE}" | grep -a "PERFORMER" | sed 's|PERFORMER ||' | sed 's|\"||g')
|
||||||
echo -n "ALBUM=$(sed 's|\ \ .*||' "${CUE}" | grep -a "TITLE" | sed 's|TITLE ||' | sed 's|\"||g');"
|
local ALBUM=$(sed 's|\ \ .*||' "${CUE}" | grep -a "TITLE" | sed 's|TITLE ||' | sed 's|\"||g')
|
||||||
echo -n "DATE=$(sed 's|\ \ .*||' "${CUE}" | grep -a "REM DATE" | sed 's|REM DATE ||');"
|
local DATE=$(sed 's|\ \ .*||' "${CUE}" | grep -a "REM DATE" | sed 's|REM DATE ||')
|
||||||
echo -n "DISCNUMBER=$(sed 's|\ \ .*||' "${CUE}" | grep -a "REM DISCNUMBER" | sed 's|REM DISCNUMBER ||');"
|
local DISCNUMBER=$(sed 's|\ \ .*||' "${CUE}" | grep -a "REM DISCNUMBER" | sed 's|REM DISCNUMBER ||')
|
||||||
echo -n "TOTALDISCS=$(sed 's|\ \ .*||' "${CUE}" | grep -a "REM TOTALDISCS" | sed 's|REM TOTALDISCS ||');"
|
local TOTALDISCS=$(sed 's|\ \ .*||' "${CUE}" | grep -a "REM TOTALDISCS" | sed 's|REM TOTALDISCS ||')
|
||||||
|
|
||||||
local COUNT=0
|
local COUNT=0
|
||||||
for trackmeta in ${trackmetaList[@]}; do
|
for trackmeta in ${trackmetaList[@]}; do
|
||||||
|
echo -n "ARTIST=${ARTIST};"
|
||||||
|
echo -n "ALBUM=${ALBUM};"
|
||||||
|
echo -n "DATE=${DATE};"
|
||||||
echo -n "TITLE=$(echo ${trackmeta} | awk 'BEGIN {RS=" "}{print $0}' | grep -a TITLE | sed 's|TITLE ||' | sed 's|\"||g');"
|
echo -n "TITLE=$(echo ${trackmeta} | awk 'BEGIN {RS=" "}{print $0}' | grep -a TITLE | sed 's|TITLE ||' | sed 's|\"||g');"
|
||||||
echo -n "PERFORMER=$(echo ${trackmeta} | awk 'BEGIN {RS=" "}{print $0}' | grep -a PERFORMER | sed 's|PERFORMER ||' | sed 's|\"||g');"
|
echo -n "PERFORMER=$(echo ${trackmeta} | awk 'BEGIN {RS=" "}{print $0}' | grep -a PERFORMER | sed 's|PERFORMER ||' | sed 's|\"||g');"
|
||||||
|
echo -n "DISCNUMBER=${DISCNUMBER};"
|
||||||
|
echo -n "TRACKNUMBER=${COUNT};"
|
||||||
|
echo -n "TOTALTRACKS=${#trackmetaList[@]};"
|
||||||
|
echo -n "TOTALDISCS=${TOTALDISCS};"
|
||||||
|
echo -n "DISCID=${DISCID};"
|
||||||
|
|
||||||
local COUNT=$(( ${COUNT} + 1 ))
|
local COUNT=$(( ${COUNT} + 1 ))
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue