mirror of
https://github.com/chenasraf/stimvisor.git
synced 2026-05-17 17:38:11 +00:00
fix: screenshots total count
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user