notify.moe/patches/update-post-structure/update-post-structure.go

21 lines
344 B
Go
Raw Normal View History

2018-10-29 08:12:34 +09:00
package main
import (
"github.com/animenotifier/arn"
"github.com/fatih/color"
)
func main() {
color.Yellow("Updating post structure")
defer color.Green("Finished.")
defer arn.Node.Close()
// Iterate over the stream
for post := range arn.StreamPosts() {
post.ParentID = post.ThreadID
post.ParentType = "Thread"
post.Save()
}
}