33 lines
586 B
Go
Raw Normal View History

2017-07-02 12:03:56 +00:00
package main
import (
2017-07-02 12:08:25 +00:00
"fmt"
"strconv"
"strings"
2017-07-02 12:03:56 +00:00
"github.com/animenotifier/arn"
"github.com/fatih/color"
)
func main() {
color.Yellow("Refreshing episode information for each anime.")
for anime := range arn.MustStreamAnime() {
2017-07-02 12:08:25 +00:00
episodeCount := len(anime.Episodes)
2017-07-02 12:03:56 +00:00
err := anime.RefreshEpisodes()
if err != nil {
2017-07-02 12:08:25 +00:00
if strings.Contains(err.Error(), "missing a Shoboi ID") {
continue
}
2017-07-02 12:03:56 +00:00
color.Red(err.Error())
2017-07-02 12:08:25 +00:00
} else {
fmt.Println(anime.ID, "|", anime.Title.Canonical, "+"+strconv.Itoa(len(anime.Episodes)-episodeCount))
2017-07-02 12:03:56 +00:00
}
}
color.Green("Finished.")
}