From 340878c65a8679506758557ca7f1962ffe22b39c Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 22 Aug 2024 15:57:25 +0100 Subject: Don't skip binarisation for folders full of images, as that's nobody's workflow anymore --- internal/pipeline/put.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'internal/pipeline/put.go') 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" -- cgit v1.2.1-24-ge1ad