From 2caec1c94dce9f2f14ada3e805cddfdeb2fe2914 Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Sun, 10 Aug 2014 02:01:13 +0200 Subject: Next function separation, +m3l_fin_table --- bin/mp3dirlist | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'bin/mp3dirlist') diff --git a/bin/mp3dirlist b/bin/mp3dirlist index 98ed3cd..e0ce5db 100755 --- a/bin/mp3dirlist +++ b/bin/mp3dirlist @@ -31,21 +31,23 @@ function m3l_prep_table { sed 's/\t0\t/\t"0"\t/g' } +function m3l_fin_table { + #Sort stuff, grep away lame artists and finally: put everything in order and remove the quotation marks + # from the entries again (leaving a whitespace char on an empty entry actually). + sort -t \t -k 1,2 -k 2,3 -k 4,5 -k 3,4 |\ + grep -vE "$DIRLISTEX" |\ + awk -F '\t' '{print $1"\t"$2"\t"$3}' |\ + sed 's/" "/ /g;s/"0"/0/g' +} + exiftool -ext .mp3 -ext .MP3 -ext .wma -ext .WMA -ext .ogg -ext .OGG -lang en -Artist -Title -Album -Year -Track -t -r $SDIR |\ m3l_rm_verb |\ m3l_prep_table |\ - sort -t \t -k 1,2 -k 2,3 -k 4,5 -k 3,4 |\ - grep -vE "$DIRLISTEX"|\ - awk -F '\t' '{print $1"\t"$2"\t"$3}' |\ - sed 's/" "/ /g;s/"0"/0/g' > content.csv + m3l_fin_table > content.csv cat "$DIRLISTHEAD" > content.php sed 's/^//g;s/\t/<\/td>/g;s/$/<\/td><\/tr>/g' content.csv >> content.php rm content.csv echo -e '\n\n\n\n\n\n' >> content.php -# sed 's/========.*/========/g' |\ -# sed 's/========\n========/========/g' | sed 's/========\n========/========/g' | sed 's/========\n========/========/g' | sed 's/========\n========/========/g' |\ -# sed 's/========\n========/========/g' | sed 's/========\n========/========/g' | sed 's/========\n========/========/g' | sed 's/========\n========/========/g' |\ -# sed 's/\t$/\t" "/g' echo -- cgit v1.2.3