Add option to generate image thumbnails during generate (#4602)

* Add option to generate image thumbnails
* Limit number of concurrent image thumbnail generation ops
This commit is contained in:
WithoutPants
2024-02-22 11:19:23 +11:00
committed by GitHub
parent c4a91d15a6
commit a8c909e0c9
14 changed files with 332 additions and 222 deletions

View File

@@ -10,6 +10,7 @@ import (
"runtime"
"time"
"github.com/remeh/sizedwaitgroup"
"github.com/stashapp/stash/internal/dlna"
"github.com/stashapp/stash/internal/log"
"github.com/stashapp/stash/internal/manager/config"
@@ -33,6 +34,10 @@ type Manager struct {
Config *config.Config
Logger *log.Logger
// ImageThumbnailGenerateWaitGroup is the global wait group image thumbnail generation
// It uses the parallel tasks setting from the configuration.
ImageThumbnailGenerateWaitGroup sizedwaitgroup.SizedWaitGroup
Paths *paths.Paths
FFMpeg *ffmpeg.FFMpeg
@@ -107,6 +112,8 @@ func (s *Manager) RefreshConfig() {
if err := fsutil.EnsureDir(s.Paths.Generated.InteractiveHeatmap); err != nil {
logger.Warnf("could not create interactive heatmaps directory: %v", err)
}
s.ImageThumbnailGenerateWaitGroup.Size = cfg.GetParallelTasksWithAutoDetection()
}
}