This commit is contained in:
@@ -83,10 +83,6 @@ func main() {
|
||||
|
||||
hideList := make(map[string]bool)
|
||||
|
||||
if parts[1] != "story" && parts[1] != "chapter" {
|
||||
continue
|
||||
}
|
||||
|
||||
log.Println("Loaded", parts[1], parts[2], "from archive.")
|
||||
|
||||
switch parts[1] {
|
||||
@@ -159,6 +155,10 @@ func main() {
|
||||
log.Fatalln("Could not parse story:", parts[2], err)
|
||||
}
|
||||
|
||||
if *flagReplace {
|
||||
_ = db.Stories().Delete(ctx, story)
|
||||
}
|
||||
|
||||
_, err = db.Stories().Insert(ctx, story)
|
||||
if err != nil {
|
||||
log.Fatalln("Could not insert story:", parts[2], err)
|
||||
@@ -179,6 +179,10 @@ func main() {
|
||||
log.Fatalln("Could not parse story:", parts[2], err)
|
||||
}
|
||||
|
||||
if *flagReplace {
|
||||
_ = db.Chapters().Delete(ctx, chapter)
|
||||
}
|
||||
|
||||
_, err = db.Chapters().Insert(ctx, chapter)
|
||||
if err != nil {
|
||||
log.Fatalln("Could not insert story:", parts[2], err)
|
||||
@@ -199,6 +203,10 @@ func main() {
|
||||
log.Fatalln("Could not parse story:", parts[2], err)
|
||||
}
|
||||
|
||||
if *flagReplace {
|
||||
_ = db.Comments().Delete(ctx, comment)
|
||||
}
|
||||
|
||||
_, err = db.Comments().Insert(ctx, comment)
|
||||
if err != nil {
|
||||
log.Fatalln("Could not insert story:", parts[2], err)
|
||||
|
||||
Reference in New Issue
Block a user