26 lines
426 B
Go
Raw Permalink Normal View History

2019-10-10 06:01:16 +00:00
package main
import (
"github.com/akyoto/color"
"github.com/animenotifier/notify.moe/arn"
)
func main() {
color.Yellow("Fixing non-existing anime relations")
defer arn.Node.Close()
count := 0
for episode := range arn.StreamEpisodes() {
anime := episode.Anime()
if anime == nil {
color.Yellow(episode.AnimeID)
2019-10-21 05:02:09 +00:00
_ = episode.Delete()
2019-10-10 06:01:16 +00:00
count++
}
}
color.Green("Finished deleting %d episodes.", count)
}