Add more examples for filename munging in the example config file
authorSteve McIntyre <steve@einval.com>
Wed, 21 Feb 2018 21:33:16 +0000 (21:33 +0000)
committerSteve McIntyre <steve@einval.com>
Wed, 21 Feb 2018 21:33:16 +0000 (21:33 +0000)
Closes Issue 49: https://abcde.einval.com/bugzilla/show_bug.cgi?id=49

abcde.conf
changelog

index 955d3b4..5c8e740 100644 (file)
 #      echo "$@" | sed -e 's/^\.*//' -e 's/ /_/g' | tr -d ":><|*/\"'?[:cntrl:]"
 #}
 #
+# More examples for custom filename munging:
+#
+# VARIANT 1: (works anywhere style)
+#
+# Translate everything to lowercase
+# replace ALL chars that may cause trouble for Linux, Windows and DOS
+# with '_' (underscore); remove double underscores; remove leading and
+# trailing underscores; recode to flat ASCII
+#
+#mungefilename ()
+#{
+#      echo "$@" | tr [A-Z] [a-z] | \
+#                      sed "s/[- ,.:\'\/!@#\?\$%\^&()]/_/g" | \
+#                      sed 's/_[_]*/_/g' | \
+#                      sed 's/^_*//' | \
+#                      sed 's/_*$//' | \
+#                      recode -f iso8859-1..flat
+#}
+#
+# VARIANT 2: (legible style)
+#
+# Accept all chars, EXCEPT '/' (obvious) or ":" (because eyeD3 cannot
+# cope with ":" in pathnames): replace them with " " (space).
+# Additionally, replace contiguous spaces with one space; strip
+# leading spaces; strip trailing spaces and recode to flat filenames.
+#
+# mungefilename ()
+# {
+#      echo "$@" |     sed "s/[:\/]/ /g" | \
+#                      sed 's/ [ ]*/ /g' | \
+#                      sed 's/^ *//' | \
+#                      sed 's/ *$//' | \
+#                      recode -f iso8859-1..flat
+# }
+
+
+#
 # Custom filename munging specific to track names:
 # By default this function will call the mungefilename function.
 #mungetrackname ()
index d5a695d..08af82c 100644 (file)
--- a/changelog
+++ b/changelog
@@ -65,6 +65,9 @@ abcde 2.8.2
    Nino Burini for the patch. Closes Issue 47 and maybe also 45:
    https://abcde.einval.com/bugzilla/show_bug.cgi?id=47
    https://abcde.einval.com/bugzilla/show_bug.cgi?id=45
+ * Add more comprehensive examples for filename munging in the example
+   config file. Closes Issue 49:
+   https://abcde.einval.com/bugzilla/show_bug.cgi?id=49
    
 abcde 2.8.1.