Refactor
This commit is contained in:
22
patches/add-draft-index/add-draft-index.go
Normal file
22
patches/add-draft-index/add-draft-index.go
Normal file
@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/fatih/color"
|
||||
)
|
||||
|
||||
func main() {
|
||||
color.Yellow("Addind draft indices")
|
||||
|
||||
// Iterate over the stream
|
||||
for user := range arn.MustStreamUsers() {
|
||||
fmt.Println(user.Nick)
|
||||
|
||||
draftIndex := arn.NewDraftIndex(user.ID)
|
||||
arn.PanicOnError(draftIndex.Save())
|
||||
}
|
||||
|
||||
color.Green("Finished.")
|
||||
}
|
@ -34,7 +34,7 @@ func main() {
|
||||
fmt.Println(user.Nick)
|
||||
|
||||
inventory := arn.NewInventory(user.ID)
|
||||
err = arn.DB.Set("Inventory", inventory.UserID, inventory)
|
||||
err = inventory.Save()
|
||||
|
||||
if err != nil {
|
||||
color.Red(err.Error())
|
||||
|
11
patches/update-soundtracks/update-soundtracks.go
Normal file
11
patches/update-soundtracks/update-soundtracks.go
Normal file
@ -0,0 +1,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/animenotifier/arn"
|
||||
)
|
||||
|
||||
func main() {
|
||||
for track := range arn.MustStreamSoundTracks() {
|
||||
arn.PanicOnError(track.Save())
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user