git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/bin/mp3dirlist
diff options
context:
space:
mode:
Diffstat (limited to 'bin/mp3dirlist')
-rwxr-xr-xbin/mp3dirlist18
1 files changed, 10 insertions, 8 deletions
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/^/<tr><td>/g;s/\t/<\/td><td>/g;s/$/<\/td><\/tr>/g' content.csv >> content.php
rm content.csv
echo -e '\n\n</table>\n</div>\n</div>\n</body>\n</html>' >> 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