Browse Source

Remove more characters from names

Matt Baer 3 months ago
parent
commit
d3782204fe
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      sanitize.go

+ 2
- 2
sanitize.go View File

@@ -55,8 +55,9 @@ func RenameTrack(file string) string {
55 55
 
56 56
 // Sanitize takes a string and removes problematic characters from it.
57 57
 func Sanitize(s string) string {
58
+	s = unidecode.Unidecode(s)
58 59
 	s = strings.Map(func(r rune) rune {
59
-		if r == '(' || r == ')' || r == '[' || r == ']' || r == '.' {
60
+		if r == '(' || r == ')' || r == '[' || r == ']' || r == '.' || r == ',' || r == '\'' || r == '"' || r == ';' {
60 61
 			return -1
61 62
 		}
62 63
 		if unicode.IsSpace(r) {
@@ -64,6 +65,5 @@ func Sanitize(s string) string {
64 65
 		}
65 66
 		return r
66 67
 	}, s)
67
-	s = unidecode.Unidecode(s)
68 68
 	return s
69 69
 }