git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/mp3dirlist15
1 files 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/^/<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' |\