From 520ac3a183f2a78f0a6c30f8d0c8b4563949d370 Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Fri, 4 Dec 2015 04:16:42 +0100 Subject: Index menu in resulting HTML --- bin/mp3dir2html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/mp3dir2html b/bin/mp3dir2html index c22509e..1fee40c 100755 --- a/bin/mp3dir2html +++ b/bin/mp3dir2html @@ -4,14 +4,15 @@ DIRLISTHEAD="/etc/mp3dir2html/head.php" # Regular expression that is to be excluded in the final listing should exist as -# DIRLISTEX='what.*ever|another.*one' in CONFFILE +# DIRLISTEX='what.*ever|another.*one' in CONFFILE. Plus, we need the resulting table's +# id as M3LTABLEID='mp3list' (or whatever else) CONFFILE='/etc/mp3dir2html/mp3dir2html.conf' # CORE SCRIPT FROM HERE. DON'T FIDDLE IF YOU DON'T KNOW WHAT YOU'RE DOING. +M3LTABLEID='mp3list' DIRLISTEX="0x1fedbeef" [ -r "$CONFFILE" ] && . "$CONFFILE" || echo "WARNING: $CONFFILE not readable..." -echo "$DIRLISTEX" function m3l_help { echo "Usage: $(basename $0) [options]";echo @@ -67,6 +68,9 @@ exiftool -ext .mp3 -ext .MP3 -ext .wma -ext .WMA -ext .ogg -ext .OGG -lang en -A m3l_fin_table > content.csv cat "$DIRLISTHEAD" > content.php +echo -n "

">>content.php +for i in `cat content.csv|awk '{print substr($0,0,1)}'|sort|tr '[:lower:]' '[:upper:]'|uniq`;do echo -n "$i">>content.php;done +echo -e "

\n">>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 -- cgit v1.2.3