mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Improve image scanning performance and thumbnail generation (#1655)
* Improve image scanning performance and thumbnail generation * Add vips-tools to build image * Add option to write generated thumbnails to disk * Fallback to image if thumbnail generation fails Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -84,6 +84,9 @@ const previewExcludeStartDefault = "0"
|
||||
const PreviewExcludeEnd = "preview_exclude_end"
|
||||
const previewExcludeEndDefault = "0"
|
||||
|
||||
const WriteImageThumbnails = "write_image_thumbnails"
|
||||
const writeImageThumbnailsDefault = true
|
||||
|
||||
const Host = "host"
|
||||
const Port = "port"
|
||||
const ExternalHost = "external_host"
|
||||
@@ -595,6 +598,14 @@ func (i *Instance) GetMaxStreamingTranscodeSize() models.StreamingResolutionEnum
|
||||
return models.StreamingResolutionEnum(ret)
|
||||
}
|
||||
|
||||
// IsWriteImageThumbnails returns true if image thumbnails should be written
|
||||
// to disk after generating on the fly.
|
||||
func (i *Instance) IsWriteImageThumbnails() bool {
|
||||
i.RLock()
|
||||
defer i.RUnlock()
|
||||
return viper.GetBool(WriteImageThumbnails)
|
||||
}
|
||||
|
||||
func (i *Instance) GetAPIKey() string {
|
||||
i.RLock()
|
||||
defer i.RUnlock()
|
||||
@@ -968,6 +979,8 @@ func (i *Instance) setDefaultValues() error {
|
||||
viper.SetDefault(PreviewAudio, previewAudioDefault)
|
||||
viper.SetDefault(SoundOnPreview, false)
|
||||
|
||||
viper.SetDefault(WriteImageThumbnails, writeImageThumbnailsDefault)
|
||||
|
||||
viper.SetDefault(Database, defaultDatabaseFilePath)
|
||||
|
||||
// Set generated to the metadata path for backwards compat
|
||||
|
||||
Reference in New Issue
Block a user