summaryrefslogtreecommitdiff
path: root/cmd/booktopipeline
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/booktopipeline')
-rw-r--r--cmd/booktopipeline/main.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/cmd/booktopipeline/main.go b/cmd/booktopipeline/main.go
index 609c3b3..b0605c6 100644
--- a/cmd/booktopipeline/main.go
+++ b/cmd/booktopipeline/main.go
@@ -78,7 +78,7 @@ func main() {
} else {
bookname = filepath.Base(bookdir)
}
-
+
if *verbose {
verboselog = log.New(os.Stdout, "", log.LstdFlags)
} else {
@@ -106,6 +106,19 @@ func main() {
} else {
qid = conn.PreQueueId()
}
+
+ pngdirs, _ := filepath.Glob(bookdir + "/*.png")
+ jpgdirs, _ := filepath.Glob(bookdir + "/*.jpg")
+ pngcount := len(pngdirs)
+ jpgcount := len(jpgdirs)
+ if pngcount > jpgcount {
+ qid = conn.WipeQueueId()
+ fmt.Println("Uploading book to wipe-only queue")
+ } else {
+ qid = conn.PreQueueId()
+ fmt.Println("Uploading book to preprocess queue")
+ }
+
verboselog.Println("Walking", bookdir)
walker := make(fileWalk)