2017-06-29 14:04:09 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2019-04-23 05:45:17 +00:00
|
|
|
"github.com/akyoto/color"
|
2019-06-03 09:32:43 +00:00
|
|
|
"github.com/animenotifier/notify.moe/arn"
|
2017-06-29 14:04:09 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
color.Yellow("Setting list item status to correct value")
|
2017-11-01 19:11:05 +00:00
|
|
|
defer arn.Node.Close()
|
2017-06-29 14:04:09 +00:00
|
|
|
|
|
|
|
// Iterate over the stream
|
2017-11-01 19:11:05 +00:00
|
|
|
for animeList := range arn.StreamAnimeLists() {
|
2017-06-29 14:04:09 +00:00
|
|
|
fmt.Println(animeList.User().Nick)
|
|
|
|
|
|
|
|
for _, item := range animeList.Items {
|
|
|
|
if item.Status == arn.AnimeListStatusPlanned && item.Episodes > 0 {
|
|
|
|
item.Status = arn.AnimeListStatusWatching
|
|
|
|
}
|
|
|
|
|
|
|
|
if item.Anime().Status == "finished" && item.Anime().EpisodeCount != 0 && item.Episodes >= item.Anime().EpisodeCount {
|
|
|
|
item.Status = arn.AnimeListStatusCompleted
|
|
|
|
item.Episodes = item.Anime().EpisodeCount
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-01 19:11:05 +00:00
|
|
|
animeList.Save()
|
2017-06-29 14:04:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
color.Green("Finished.")
|
|
|
|
}
|