diff --git a/pages/anime/anime.pixy b/pages/anime/anime.pixy index b84bd84d..355e1efb 100644 --- a/pages/anime/anime.pixy +++ b/pages/anime/anime.pixy @@ -126,10 +126,6 @@ component AnimeLinks(anime *arn.Anime, user *arn.User) a.light-button(href=link.URL, target="_blank", rel="noopener") Icon("external-link") span= link.Title - - a.light-button(href="https://kitsu.io/anime/" + anime.ID, target="_blank", rel="noopener") - Icon("external-link") - span Kitsu each mapping in anime.Mappings a.light-button(href=mapping.Link(), target="_blank", rel="noopener") diff --git a/patches/add-kitsu-mapping/add-kitsu-mapping.go b/patches/add-kitsu-mapping/add-kitsu-mapping.go new file mode 100644 index 00000000..ef9d818f --- /dev/null +++ b/patches/add-kitsu-mapping/add-kitsu-mapping.go @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "time" + + "github.com/animenotifier/arn" + "github.com/fatih/color" +) + +func main() { + color.Yellow("Adding kitsu/anime mappings") + + defer color.Green("Finished") + defer arn.Node.Close() + + for anime := range arn.StreamAnime() { + fmt.Println(anime.ID, anime) + anime.SetMapping("kitsu/anime", anime.ID) + anime.Save() + } + + time.Sleep(time.Second) +} diff --git a/patches/add-mal-genres/add-mal-genres.go b/patches/add-mal-genres/add-mal-genres.go deleted file mode 100644 index 1463b616..00000000 --- a/patches/add-mal-genres/add-mal-genres.go +++ /dev/null @@ -1,48 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/animenotifier/arn" - "github.com/animenotifier/mal" - "github.com/fatih/color" -) - -func main() { - defer arn.Node.Close() - - count := 0 - - for anime := range arn.StreamAnime() { - if len(anime.Genres) > 0 { - continue - } - - malID := anime.GetMapping("myanimelist/anime") - - if malID == "" { - continue - } - - malAnimeObj, err := arn.MAL.Get("Anime", malID) - - if err != nil { - continue - } - - malAnime := malAnimeObj.(*mal.Anime) - - if len(malAnime.Genres) == 0 { - continue - } - - anime.Genres = malAnime.Genres - anime.Save() - - count++ - - fmt.Println(anime.ID, anime, anime.Genres) - } - - color.Green("Added genres to %d anime", count) -}