Ver código fonte

Remove more characters from names

main
Matt Baer 4 anos atrás
pai
commit
d3782204fe
1 arquivos alterados com 2 adições e 2 exclusões
  1. +2
    -2
      sanitize.go

+ 2
- 2
sanitize.go Ver arquivo

@@ -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
}

Carregando…
Cancelar
Salvar