Cleanup
This commit is contained in:
29
patches/add-last-seen/add-last-seen.go
Normal file
29
patches/add-last-seen/add-last-seen.go
Normal file
@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/animenotifier/arn"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Get a stream of all users
|
||||
allUsers, err := arn.StreamUsers()
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Iterate over the stream
|
||||
for user := range allUsers {
|
||||
if user.LastSeen != "" {
|
||||
continue
|
||||
}
|
||||
|
||||
user.LastSeen = user.LastLogin
|
||||
|
||||
if user.LastSeen == "" {
|
||||
user.LastSeen = user.Registered
|
||||
}
|
||||
|
||||
user.Save()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user