Migration to nano
This commit is contained in:
@ -13,6 +13,7 @@ var popularity = map[string]*arn.AnimePopularity{}
|
||||
// made to it.
|
||||
func main() {
|
||||
color.Yellow("Updating anime ratings")
|
||||
defer arn.Node.Close()
|
||||
|
||||
allAnimeLists, err := arn.AllAnimeLists()
|
||||
arn.PanicOnError(err)
|
||||
@ -58,7 +59,7 @@ func main() {
|
||||
anime, err := arn.GetAnime(animeID)
|
||||
arn.PanicOnError(err)
|
||||
anime.Rating = finalRating[animeID]
|
||||
arn.PanicOnError(anime.Save())
|
||||
anime.Save()
|
||||
}
|
||||
|
||||
// Save popularity
|
||||
@ -66,7 +67,7 @@ func main() {
|
||||
anime, err := arn.GetAnime(animeID)
|
||||
arn.PanicOnError(err)
|
||||
anime.Popularity = popularity[animeID]
|
||||
arn.PanicOnError(anime.Save())
|
||||
anime.Save()
|
||||
}
|
||||
|
||||
color.Green("Finished.")
|
||||
|
@ -21,6 +21,7 @@ var wg sync.WaitGroup
|
||||
// Main
|
||||
func main() {
|
||||
color.Yellow("Generating user avatars")
|
||||
defer arn.Node.Close()
|
||||
|
||||
// Switch to main directory
|
||||
exe, err := os.Executable()
|
||||
|
@ -23,9 +23,7 @@ var colorPool = []*color.Color{
|
||||
}
|
||||
|
||||
var jobs = map[string]time.Duration{
|
||||
"forum-activity": 1 * time.Minute,
|
||||
"anime-ratings": 10 * time.Minute,
|
||||
"popular-anime": 20 * time.Minute,
|
||||
"avatars": 1 * time.Hour,
|
||||
"test": 1 * time.Hour,
|
||||
"twist": 2 * time.Hour,
|
||||
|
@ -18,7 +18,7 @@ var packages = []string{
|
||||
"github.com/animenotifier/shoboi",
|
||||
"github.com/animenotifier/twist",
|
||||
"github.com/animenotifier/avatar",
|
||||
"github.com/animenotifier/japanese",
|
||||
// "github.com/animenotifier/japanese",
|
||||
// "github.com/animenotifier/osu",
|
||||
}
|
||||
|
||||
|
@ -13,15 +13,17 @@ import (
|
||||
var rateLimiter = time.NewTicker(500 * time.Millisecond)
|
||||
|
||||
func main() {
|
||||
defer arn.Node.Close()
|
||||
|
||||
// Replace this with ID list from twist.moe later
|
||||
twistAnime, err := twist.GetAnimeIndex()
|
||||
arn.PanicOnError(err)
|
||||
idList := twistAnime.KitsuIDs()
|
||||
|
||||
// Save index in cache
|
||||
arn.PanicOnError(arn.DB.Set("Cache", "animetwist index", &arn.ListOfIDs{
|
||||
arn.DB.Set("Cache", "animetwist index", &arn.ListOfIDs{
|
||||
IDList: idList,
|
||||
}))
|
||||
})
|
||||
|
||||
color.Yellow("Refreshing twist.moe links for %d anime", len(idList))
|
||||
|
||||
|
Reference in New Issue
Block a user