Procházet zdrojové kódy

Remove more characters from names

main
Matt Baer před 4 roky
rodič
revize
d3782204fe
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. +2
    -2
      sanitize.go

+ 2
- 2
sanitize.go Zobrazit soubor

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

Načítá se…
Zrušit
Uložit