Fixed old stuff
This commit is contained in:
@ -1,32 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/fatih/color"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Get a stream of all anime
|
||||
allAnime, err := arn.AllAnime()
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Iterate over the stream
|
||||
for _, anime := range allAnime {
|
||||
if anime.Mappings == nil {
|
||||
anime.Mappings = []*arn.Mapping{}
|
||||
}
|
||||
|
||||
if anime.Episodes == nil {
|
||||
anime.Episodes = []*arn.AnimeEpisode{}
|
||||
}
|
||||
|
||||
err := anime.Save()
|
||||
|
||||
if err != nil {
|
||||
color.Red("Error saving anime: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/animenotifier/arn"
|
||||
)
|
||||
|
||||
func main() {
|
||||
for anime := range arn.MustStreamAnime() {
|
||||
arn.PanicOnError(arn.DB.Set("AnimeEpisodes", anime.ID, &arn.AnimeEpisodes{
|
||||
AnimeID: anime.ID,
|
||||
Items: anime.Episodes,
|
||||
}))
|
||||
|
||||
anime.Episodes = anime.Episodes[:0]
|
||||
anime.MustSave()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user