Added genre whitespace fix
This commit is contained in:
parent
cda27355a2
commit
d7517012dd
27
patches/fix-genres/fix-genres.go
Normal file
27
patches/fix-genres/fix-genres.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/animenotifier/arn"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
defer arn.Node.Close()
|
||||||
|
|
||||||
|
for anime := range arn.StreamAnime() {
|
||||||
|
for i := 0; i < len(anime.Genres); i++ {
|
||||||
|
old := anime.Genres[i]
|
||||||
|
genre := strings.TrimSpace(anime.Genres[i])
|
||||||
|
|
||||||
|
if genre != old {
|
||||||
|
fmt.Println(anime.Title.Canonical, genre)
|
||||||
|
}
|
||||||
|
|
||||||
|
anime.Genres[i] = genre
|
||||||
|
}
|
||||||
|
|
||||||
|
anime.Save()
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user