Fixed sync-anime

This commit is contained in:
Eduard Urbach 2017-11-07 12:35:32 +01:00
parent efe8e0494d
commit 5d7ed358ba
2 changed files with 32 additions and 1 deletions

View File

@ -133,7 +133,12 @@ func sync(data *kitsu.Anime) *arn.Anime {
episodes, err := arn.GetAnimeEpisodes(anime.ID)
if err != nil || episodes == nil {
anime.RefreshEpisodes()
episodes := &arn.AnimeEpisodes{
AnimeID: anime.ID,
Items: []*arn.AnimeEpisode{},
}
arn.DB.Set("AnimeEpisodes", anime.ID, episodes)
}
// Log

View File

@ -0,0 +1,26 @@
package main
import (
"fmt"
"github.com/animenotifier/arn"
)
func main() {
defer arn.Node.Close()
for anime := range arn.StreamAnime() {
if anime.Episodes() != nil {
continue
}
fmt.Println(anime)
episodes := &arn.AnimeEpisodes{
AnimeID: anime.ID,
Items: []*arn.AnimeEpisode{},
}
arn.DB.Set("AnimeEpisodes", anime.ID, episodes)
}
}