Minor changes

This commit is contained in:
Eduard Urbach 2018-12-11 14:51:17 +09:00
parent a0b69fc953
commit 2c487d4308

View File

@ -1,6 +1,8 @@
package main package main
import ( import (
"fmt"
"github.com/animenotifier/arn" "github.com/animenotifier/arn"
"github.com/fatih/color" "github.com/fatih/color"
) )
@ -17,10 +19,9 @@ func main() {
defer color.Green("Finished.") defer color.Green("Finished.")
defer arn.Node.Close() defer arn.Node.Close()
allAnimeLists, err := arn.AllAnimeLists() fmt.Println("Processing anime lists")
arn.PanicOnError(err)
for _, animeList := range allAnimeLists { for animeList := range arn.StreamAnimeLists() {
extractRatings(animeList) extractRatings(animeList)
extractPopularity(animeList) extractPopularity(animeList)
} }
@ -80,7 +81,9 @@ func main() {
finalRating[animeID].Soundtrack = average(soundtrack) finalRating[animeID].Soundtrack = average(soundtrack)
} }
// Save // Save rating
fmt.Println("Saving rating")
for animeID := range finalRating { for animeID := range finalRating {
anime, err := arn.GetAnime(animeID) anime, err := arn.GetAnime(animeID)
arn.PanicOnError(err) arn.PanicOnError(err)
@ -89,6 +92,8 @@ func main() {
} }
// Save popularity // Save popularity
fmt.Println("Saving popularity")
for animeID := range popularity { for animeID := range popularity {
anime, err := arn.GetAnime(animeID) anime, err := arn.GetAnime(animeID)
arn.PanicOnError(err) arn.PanicOnError(err)