Migrate to new follows storage
This commit is contained in:
22
patches/user-copy-follows/user-copy-follow.go
Normal file
22
patches/user-copy-follows/user-copy-follow.go
Normal file
@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/akyoto/color"
|
||||
"github.com/animenotifier/notify.moe/arn"
|
||||
)
|
||||
|
||||
func main() {
|
||||
defer arn.Node.Close()
|
||||
|
||||
for follows := range arn.StreamUserFollows() {
|
||||
user, err := arn.GetUser(follows.UserID)
|
||||
|
||||
if err != nil {
|
||||
color.Red(err.Error())
|
||||
continue
|
||||
}
|
||||
|
||||
user.FollowIDs = follows.Items
|
||||
user.Save()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user