From ee8f6447eb4d634a335b5ab4e65b85c129d0b1bf Mon Sep 17 00:00:00 2001 From: Deluan Date: Mon, 6 Feb 2023 09:50:04 -0500 Subject: [PATCH] Add option to disable Cache Warmer. Related to #2142 --- conf/configuration.go | 2 ++ core/artwork/cache_warmer.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/configuration.go b/conf/configuration.go index ee41432c..7471af81 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 eeb426a0..eed935e9 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{} }