Selaa lähdekoodia

Remove more characters from names

main
Matt Baer 4 vuotta sitten
vanhempi
commit
d3782204fe
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. +2
    -2
      sanitize.go

+ 2
- 2
sanitize.go Näytä tiedosto

@@ -55,8 +55,9 @@ func RenameTrack(file string) string {

// Sanitize takes a string and removes problematic characters from it.
func Sanitize(s string) string {
s = unidecode.Unidecode(s)
s = strings.Map(func(r rune) rune {
if r == '(' || r == ')' || r == '[' || r == ']' || r == '.' {
if r == '(' || r == ')' || r == '[' || r == ']' || r == '.' || r == ',' || r == '\'' || r == '"' || r == ';' {
return -1
}
if unicode.IsSpace(r) {
@@ -64,6 +65,5 @@ func Sanitize(s string) string {
}
return r
}, s)
s = unidecode.Unidecode(s)
return s
}

Ladataan…
Peruuta
Tallenna