From 3d9abaff6aa35816882cae3759f03773a176007f 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 dbba4f0bf..7b0e3b0db 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 @@ -243,6 +244,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{} }