diff options
author | mail_redacted_for_web | 2015-12-04 04:16:42 +0100 |
---|---|---|
committer | mail_redacted_for_web | 2015-12-04 04:16:42 +0100 |
commit | 520ac3a183f2a78f0a6c30f8d0c8b4563949d370 (patch) | |
tree | 3ec7478900c2118701542d7a3f3a3f0a14a57e38 | |
parent | 29dfcc23e8e6fe07b1e8b901dc0d11de3413c68f (diff) | |
download | mp3dir2html-master.tar.bz2 |
-rwxr-xr-x | bin/mp3dir2html | 8 |
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 |