commit 9a96073030739541b4cebe4571e2bdd02aee044b
parent f2415ddcc7e3466781d50e92d0b947b05ee0cae8
Author: lostd <lostd@2f30.org>
Date: Mon, 22 Dec 2014 00:53:39 +0200
Do not use slash and dot in filenames
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/bin/musicfix b/bin/musicfix
@@ -53,6 +53,8 @@ Stringex::Localization.store_translations :en, :transliterations, syms
# Convert to lowercase ASCII without punctuation
# Convert "Jean-Michel Jarre" to "jean_michel_jarre"
+# Convert "Aaah...!" to "aaah"
+# Convert "Ruh / Spirit" to "ruh_spirit"
def mkname n
# These may be in track titles like "(7'' Version)"
n = n.gsub '12"', '12 inch'
@@ -65,6 +67,8 @@ def mkname n
n = n.gsub "7''", "7 inch"
n = n.gsub "7'", "7 inch"
n = n.gsub " & ", " and "
+ n = n.gsub '.', ' '
+ n = n.gsub '/', ' '
# Transliterate
n.to_url.gsub '-', '_'
end