git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormail_redacted_for_web 2014-08-10 02:01:13 +0200
committermail_redacted_for_web 2014-08-10 02:01:13 +0200
commit2caec1c94dce9f2f14ada3e805cddfdeb2fe2914 (patch)
tree53296b789d8f0768f552f300a611e0a938dcf703
parent8ce94d2ac21422dceefc536e6964b64df8008200 (diff)
downloadmp3dir2html-2caec1c94dce9f2f14ada3e805cddfdeb2fe2914.tar.bz2
Next function separation, +m3l_fin_table
-rwxr-xr-xbin/mp3dirlist18
1 files changed, 10 insertions, 8 deletions
diff --git a/bin/mp3dirlist b/bin/mp3dirlist
index 98ed3cd..e0ce5db 100755
--- a/bin/mp3dirlist
+++ b/bin/mp3dirlist
@@ -31,21 +31,23 @@ function m3l_prep_table {
sed 's/\t0\t/\t"0"\t/g'
}
+function m3l_fin_table {
+ #Sort stuff, grep away lame artists and finally: put everything in order and remove the quotation marks
+ # from the entries again (leaving a whitespace char on an empty entry actually).
+ sort -t \t -k 1,2 -k 2,3 -k 4,5 -k 3,4 |\
+ grep -vE "$DIRLISTEX" |\
+ awk -F '\t' '{print $1"\t"$2"\t"$3}' |\
+ sed 's/" "/ /g;s/"0"/0/g'
+}
+
exiftool -ext .mp3 -ext .MP3 -ext .wma -ext .WMA -ext .ogg -ext .OGG -lang en -Artist -Title -Album -Year -Track -t -r $SDIR |\
m3l_rm_verb |\
m3l_prep_table |\
- sort -t \t -k 1,2 -k 2,3 -k 4,5 -k 3,4 |\
- grep -vE "$DIRLISTEX"|\
- awk -F '\t' '{print $1"\t"$2"\t"$3}' |\
- sed 's/" "/ /g;s/"0"/0/g' > content.csv
+ m3l_fin_table > content.csv
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' |\
-# sed 's/========\n========/========/g' | sed 's/========\n========/========/g' | sed 's/========\n========/========/g' | sed 's/========\n========/========/g' |\
-# sed 's/========\n========/========/g' | sed 's/========\n========/========/g' | sed 's/========\n========/========/g' | sed 's/========\n========/========/g' |\
-# sed 's/\t$/\t" "/g'
echo