From a3c96046e7dda5d18c0bfdf07df9952b7ecf9670 Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Sat, 9 Aug 2014 20:56:47 +0200 Subject: move of the header file, regex now in head of script --- bin/mp3dirlist | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bin/mp3dirlist b/bin/mp3dirlist index 7c98b2c..4bba771 100755 --- a/bin/mp3dirlist +++ b/bin/mp3dirlist @@ -1,10 +1,10 @@ #!/bin/bash -if [ -e "temp.csv" ]; then - exit 127 -elif [ -e "content.csv" ]; then - exit 127 -fi +# Paste a file here that contains the HTML code to be placed _before_ the MP3 tag list. +DIRLISTHEAD="/etc/mp3dir2html/head.php" + +# Regular expression that is to be excluded in the final listing +DIRLISTEX='^Susperia|^B.*hse.*nkelz' if [ "$1" == "" ]; then SDIR="*" @@ -39,12 +39,13 @@ exiftool -ext .mp3 -ext .MP3 -ext .wma -ext .WMA -ext .ogg -ext .OGG -lang en -A ## sort -t \t -k 1,1 -k 2,2n -k 3,3 -k 4,4 |\ ## sort -t \t -k 1,1 |\ sort -t \t -k 1,2 -k 2,3 -k 4,5 -k 3,4 |\ - grep -vE '^Susperia|^B.*hse.*nkelz' |\ + grep -vE "$DIRLISTEX"|\ awk -F '\t' '{print $1"\t"$2"\t"$3}' |\ sed 's/" "/ /g;s/"0"/0/g' > content.csv -cat /windows/D/MP3s/raw.php > content.php +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' |\ -- cgit v1.2.3