Skip to content

🎧 Your Personal Streaming Service

Add option to disable Cache Warmer. Related to #2142

Deluanee8f6447eb4d
diff --git a/conf/configuration.go b/conf/configuration.go
index ee41432c0..7471af811 100644
--- a/conf/configuration.go
+++ b/conf/configuration.go
@@ -37,6 +37,7 @@ type configOptions struct {
EnableMediaFileCoverArt bool
TranscodingCacheSize string
ImageCacheSize string
+ EnableArtworkPrecache bool
AutoImportPlaylists bool
PlaylistsPath string
AutoTranscodeDownload bool
@@ -232,6 +233,7 @@ func init() {
viper.SetDefault("enabletranscodingconfig", false)
viper.SetDefault("transcodingcachesize", "100MB")
viper.SetDefault("imagecachesize", "100MB")
+ viper.SetDefault("enableartworkprecache", true)
viper.SetDefault("autoimportplaylists", true)
viper.SetDefault("playlistspath", consts.DefaultPlaylistsPath)
viper.SetDefault("enabledownloads", true)
diff --git a/core/artwork/cache_warmer.go b/core/artwork/cache_warmer.go
index eeb426a03..eed935e9f 100644
--- a/core/artwork/cache_warmer.go
+++ b/core/artwork/cache_warmer.go
@@ -23,7 +23,7 @@ type CacheWarmer interface {
func NewCacheWarmer(artwork Artwork, cache cache.FileCache) CacheWarmer {
// If image cache is disabled, return a NOOP implementation
- if conf.Server.ImageCacheSize == "0" {
+ if conf.Server.ImageCacheSize == "0" || !conf.Server.EnableArtworkPrecache {
return &noopCacheWarmer{}
}