Fixed sync-anime
This commit is contained in:
parent
efe8e0494d
commit
5d7ed358ba
@ -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
|
||||
|
26
patches/add-episodes/add-episodes.go
Normal file
26
patches/add-episodes/add-episodes.go
Normal 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)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user