summaryrefslogtreecommitdiff
path: root/internal/pipeline/put.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2024-08-22 15:57:25 +0100
committerNick White <git@njw.name>2024-08-22 15:57:25 +0100
commit340878c65a8679506758557ca7f1962ffe22b39c (patch)
tree846df92426704904fb7f675798371138dd8e41b2 /internal/pipeline/put.go
parent6c56a6884e78a50982a01acb9d8da4e7f28287a7 (diff)
Don't skip binarisation for folders full of images, as that's nobody's workflow anymore
Diffstat (limited to 'internal/pipeline/put.go')
-rw-r--r--internal/pipeline/put.go14
1 files changed, 3 insertions, 11 deletions
diff --git a/internal/pipeline/put.go b/internal/pipeline/put.go
index fed04f8..aaadaae 100644
--- a/internal/pipeline/put.go
+++ b/internal/pipeline/put.go
@@ -84,21 +84,13 @@ func CheckImages(ctx context.Context, dir string) error {
return nil
}
-// DetectQueueType detects which queue to use based on the preponderance
-// of files of a particular extension in a directory
+// DetectQueueType returns which queue to use based on the whether
+// wipe is requested
func DetectQueueType(dir string, conn Queuer, nowipe bool) string {
if nowipe {
return conn.PreNoWipeQueueId()
}
- pngdirs, _ := filepath.Glob(dir + "/*.png")
- jpgdirs, _ := filepath.Glob(dir + "/*.jpg")
- pngcount := len(pngdirs)
- jpgcount := len(jpgdirs)
- if pngcount > jpgcount {
- return conn.WipeQueueId()
- } else {
- return conn.PreQueueId()
- }
+ return conn.PreQueueId()
}
// UploadImages uploads all files with a suffix of ".jpg" or ".png"