Added patch to replace anime in user lists

This commit is contained in:
Eduard Urbach 2020-04-29 09:23:06 +09:00
parent 186a00a240
commit 07403f01f2
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0

View File

@ -0,0 +1,31 @@
package main
import (
"fmt"
"os"
"github.com/animenotifier/notify.moe/arn"
)
func main() {
defer arn.Node.Close()
oldID := os.Args[1]
newID := os.Args[2]
if oldID == "" || newID == "" {
fmt.Println("Parameters: [old ID] [new ID]")
os.Exit(1)
}
for animeList := range arn.StreamAnimeLists() {
item := animeList.Find(oldID)
if item == nil {
continue
}
item.AnimeID = newID
animeList.Save()
}
}