Skip to content

Commit

Permalink
Add option to disable Cache Warmer. Related to #2142
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Feb 6, 2023
1 parent dad4949 commit ee8f644
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions conf/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type configOptions struct {
EnableMediaFileCoverArt bool
TranscodingCacheSize string
ImageCacheSize string
EnableArtworkPrecache bool
AutoImportPlaylists bool
PlaylistsPath string
AutoTranscodeDownload bool
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion core/artwork/cache_warmer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
}

Expand Down

0 comments on commit ee8f644

Please sign in to comment.