From addcfe09423c07e53dfa7b55c36326f747fff318 Mon Sep 17 00:00:00 2001 From: Chen Asraf Date: Mon, 21 Oct 2024 03:13:10 +0300 Subject: [PATCH] fix: screenshots total count --- screenshots/screenshots.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/screenshots/screenshots.go b/screenshots/screenshots.go index d73aae2..a78ff54 100644 --- a/screenshots/screenshots.go +++ b/screenshots/screenshots.go @@ -47,14 +47,10 @@ func NewScreenshotsDirFromPath(path string, limit int) ScreenshotCollection { if err != nil { return s } - s.TotalCount = len(files) for i, f := range files { if f.IsDir() { continue } - if limit > 0 && i >= limit { - break - } path := fmt.Sprintf("%s/%s", path, f.Name()) // s.Screenshots = append(s.Screenshots, fmt.Sprintf("%s/%s", path, f.Name())) // convert to base64 @@ -77,6 +73,10 @@ func NewScreenshotsDirFromPath(path string, limit int) ScreenshotCollection { default: continue } + s.TotalCount++ + if limit > 0 && i >= limit { + continue + } b64 += base64.StdEncoding.EncodeToString(bytes) entry := ScreenshotEntry{ Dir: filepath.Dir(path),