Updated struct
This commit is contained in:
@ -8,8 +8,8 @@ import (
|
||||
|
||||
func main() {
|
||||
for user := range arn.MustStreamUsers() {
|
||||
if !strings.HasPrefix(user.AvatarExtension, ".") {
|
||||
user.AvatarExtension = ""
|
||||
if !strings.HasPrefix(user.Avatar.Extension, ".") {
|
||||
user.Avatar.Extension = ""
|
||||
}
|
||||
|
||||
user.Save()
|
||||
|
@ -1,24 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/fatih/color"
|
||||
"github.com/jinzhu/copier"
|
||||
)
|
||||
|
||||
func main() {
|
||||
color.Yellow("Updating user struct")
|
||||
|
||||
// Iterate over the stream
|
||||
for user := range arn.MustStreamUsers() {
|
||||
newUser := &arn.UserNew{}
|
||||
// // Iterate over the stream
|
||||
// for user := range arn.MustStreamUsers() {
|
||||
// newUser := &arn.UserNew{}
|
||||
|
||||
copier.Copy(newUser, user)
|
||||
newUser.Avatar.Extension = user.Avatar
|
||||
// copier.Copy(newUser, user)
|
||||
// newUser.Avatar.Extension = user.Avatar
|
||||
|
||||
// Save in DB
|
||||
arn.PanicOnError(arn.DB.Set("User", user.ID, newUser))
|
||||
}
|
||||
// // Save in DB
|
||||
// arn.PanicOnError(arn.DB.Set("User", user.ID, newUser))
|
||||
// }
|
||||
|
||||
color.Green("Finished.")
|
||||
}
|
||||
|
Reference in New Issue
Block a user