git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authormail_redacted_for_web 2015-12-04 04:16:42 +0100
committermail_redacted_for_web 2015-12-04 04:16:42 +0100
commit520ac3a183f2a78f0a6c30f8d0c8b4563949d370 (patch)
tree3ec7478900c2118701542d7a3f3a3f0a14a57e38 /bin
parent29dfcc23e8e6fe07b1e8b901dc0d11de3413c68f (diff)
downloadmp3dir2html-master.tar.bz2
Index menu in resulting HTMLHEADmaster
Diffstat (limited to 'bin')
-rwxr-xr-xbin/mp3dir2html8
1 files 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 "<div id='m3lmenu'><p>">>content.php
+for i in `cat content.csv|awk '{print substr($0,0,1)}'|sort|tr '[:lower:]' '[:upper:]'|uniq`;do echo -n "<a href=\"#_$i\">$i</a>">>content.php;done
+echo -e "</p></div>\n<table id='$M3LTABLEID'>">>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