From 3980302d5ef4a1168f88b0e7e59748ecf132c286 Mon Sep 17 00:00:00 2001 From: DingDongSoLong4 <99329275+DingDongSoLong4@users.noreply.github.com> Date: Tue, 17 May 2022 10:12:13 +0200 Subject: [PATCH] Fix gallery scan The incorrect error check means that images is always 0, which means scanImages is also always true, which causes the images inside the zip to be unnecessarily rescanned every time. --- internal/manager/task_scan_gallery.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/manager/task_scan_gallery.go b/internal/manager/task_scan_gallery.go index 25bd1f17d4e..8c3f5c55061 100644 --- a/internal/manager/task_scan_gallery.go +++ b/internal/manager/task_scan_gallery.go @@ -25,7 +25,7 @@ func (t *ScanTask) scanGallery(ctx context.Context) { var err error g, err = r.Gallery().FindByPath(path) - if g != nil && err != nil { + if g != nil && err == nil { images, err = r.Image().CountByGalleryID(g.ID) if err != nil { return fmt.Errorf("error getting images for zip gallery %s: %s", path, err.Error())