Added wikipedia links
This commit is contained in:
parent
2010e9ed68
commit
518c7bbc61
@ -36,7 +36,7 @@ component AnimeSideColumn(anime *arn.Anime, friends []*arn.User, listItems map[*
|
||||
AnimeRatings(anime, user)
|
||||
AnimePopularity(anime)
|
||||
AnimeFriends(friends, listItems)
|
||||
AnimeLinks(anime)
|
||||
AnimeLinks(anime, user)
|
||||
|
||||
component AnimeActions(anime *arn.Anime, listItem *arn.AnimeListItem, user *arn.User)
|
||||
if user != nil
|
||||
@ -118,7 +118,7 @@ component AnimePopularity(anime *arn.Anime)
|
||||
td.anime-info-key Dropped:
|
||||
td.anime-info-value= anime.Popularity.Dropped
|
||||
|
||||
component AnimeLinks(anime *arn.Anime)
|
||||
component AnimeLinks(anime *arn.Anime, user *arn.User)
|
||||
section.anime-section.mountable
|
||||
h3.anime-section-name Links
|
||||
.light-button-group
|
||||
@ -136,6 +136,10 @@ component AnimeLinks(anime *arn.Anime)
|
||||
Icon("external-link")
|
||||
span= mapping.Name()
|
||||
|
||||
a.light-button(href="https://www.google.com/search?btnI=745&q=" + anime.Title.ByUser(user) + "+TV+series+site%3Aen.wikipedia.org", target="_blank", rel="noopener")
|
||||
Icon("wikipedia-w")
|
||||
span Wikipedia
|
||||
|
||||
component AnimeGenres(anime *arn.Anime)
|
||||
.anime-genres
|
||||
each genre in anime.Genres
|
||||
|
@ -1,48 +0,0 @@
|
||||
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