Display anime source
This commit is contained in:
parent
e3997a8f49
commit
796a9b2b96
@ -216,6 +216,11 @@ component AnimeInformation(anime *arn.Anime)
|
||||
td.anime-info-key End date:
|
||||
td.anime-info-value= anime.EndDate
|
||||
|
||||
if anime.Source != "" && arn.AnimeSourceHumanReadable[anime.Source] != ""
|
||||
tr.mountable(data-mountable-type="info")
|
||||
td.anime-info-key Source:
|
||||
td.anime-info-value= arn.AnimeSourceHumanReadable[anime.Source]
|
||||
|
||||
if anime.FirstChannel != ""
|
||||
tr.mountable(data-mountable-type="info")
|
||||
td.anime-info-key Channel:
|
||||
|
48
patches/add-mal-fields/add-mal-fields.go
Normal file
48
patches/add-mal-fields/add-mal-fields.go
Normal file
@ -0,0 +1,48 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"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() {
|
||||
malID := anime.GetMapping("myanimelist/anime")
|
||||
|
||||
if malID == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
malAnimeObj, err := arn.MAL.Get("Anime", malID)
|
||||
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
malAnime := malAnimeObj.(*mal.Anime)
|
||||
|
||||
fmt.Println(anime.Source)
|
||||
|
||||
anime.Source = strings.ToLower(malAnime.Source)
|
||||
|
||||
if anime.Source == "Unknown" {
|
||||
anime.Source = ""
|
||||
}
|
||||
|
||||
anime.Save()
|
||||
|
||||
count++
|
||||
|
||||
fmt.Println(anime.ID, anime, anime.Source)
|
||||
}
|
||||
|
||||
color.Green("Processed %d anime", count)
|
||||
}
|
Loading…
Reference in New Issue
Block a user