Added patch for character name unescaping
This commit is contained in:
parent
0baf37f1bf
commit
305c20f5a6
26
patches/character-unescape-name/character-unescape-name.go
Normal file
26
patches/character-unescape-name/character-unescape-name.go
Normal file
@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"html"
|
||||
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/fatih/color"
|
||||
)
|
||||
|
||||
func main() {
|
||||
color.Yellow("Unescape HTML entities in character names")
|
||||
|
||||
defer color.Green("Finished.")
|
||||
defer arn.Node.Close()
|
||||
|
||||
for character := range arn.StreamCharacters() {
|
||||
unescapedName := html.UnescapeString(character.Name.Canonical)
|
||||
|
||||
if character.Name.Canonical != unescapedName {
|
||||
fmt.Println(character.Name.Canonical, "->", unescapedName)
|
||||
character.Name.Canonical = unescapedName
|
||||
character.Save()
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user