feat(conf): add MaxConcurrentTranscodes and dev throttle config options

This commit is contained in:
Deluan 2026-03-25 07:58:41 -04:00
parent 58f7959204
commit 9219a8c2a4

View File

@ -58,6 +58,7 @@ type configOptions struct {
PlaylistsPath string PlaylistsPath string
SmartPlaylistRefreshDelay time.Duration SmartPlaylistRefreshDelay time.Duration
AutoTranscodeDownload bool AutoTranscodeDownload bool
MaxConcurrentTranscodes int
DefaultDownsamplingFormat string DefaultDownsamplingFormat string
Search searchOptions `json:",omitzero"` Search searchOptions `json:",omitzero"`
SimilarSongsMatchThreshold int SimilarSongsMatchThreshold int
@ -128,6 +129,8 @@ type configOptions struct {
DevArtworkMaxRequests int DevArtworkMaxRequests int
DevArtworkThrottleBacklogLimit int DevArtworkThrottleBacklogLimit int
DevArtworkThrottleBacklogTimeout time.Duration DevArtworkThrottleBacklogTimeout time.Duration
DevTranscodeThrottleBacklogLimit int
DevTranscodeThrottleBacklogTimeout time.Duration
DevArtistInfoTimeToLive time.Duration DevArtistInfoTimeToLive time.Duration
DevAlbumInfoTimeToLive time.Duration DevAlbumInfoTimeToLive time.Duration
DevExternalScanner bool DevExternalScanner bool
@ -663,6 +666,7 @@ func setViperDefaults() {
viper.SetDefault("enablem3uexternalalbumart", false) viper.SetDefault("enablem3uexternalalbumart", false)
viper.SetDefault("enablemediafilecoverart", true) viper.SetDefault("enablemediafilecoverart", true)
viper.SetDefault("autotranscodedownload", false) viper.SetDefault("autotranscodedownload", false)
viper.SetDefault("maxconcurrenttranscodes", 4)
viper.SetDefault("defaultdownsamplingformat", consts.DefaultDownsamplingFormat) viper.SetDefault("defaultdownsamplingformat", consts.DefaultDownsamplingFormat)
viper.SetDefault("search.fullstring", false) viper.SetDefault("search.fullstring", false)
viper.SetDefault("search.backend", "fts") viper.SetDefault("search.backend", "fts")
@ -770,6 +774,8 @@ func setViperDefaults() {
viper.SetDefault("devartworkmaxrequests", max(4, runtime.NumCPU())) viper.SetDefault("devartworkmaxrequests", max(4, runtime.NumCPU()))
viper.SetDefault("devartworkthrottlebackloglimit", consts.RequestThrottleBacklogLimit) viper.SetDefault("devartworkthrottlebackloglimit", consts.RequestThrottleBacklogLimit)
viper.SetDefault("devartworkthrottlebacklogtimeout", consts.RequestThrottleBacklogTimeout) viper.SetDefault("devartworkthrottlebacklogtimeout", consts.RequestThrottleBacklogTimeout)
viper.SetDefault("devtranscodethrottlebackloglimit", consts.RequestThrottleBacklogLimit)
viper.SetDefault("devtranscodethrottlebacklogtimeout", consts.RequestThrottleBacklogTimeout)
viper.SetDefault("devartistinfotimetolive", consts.ArtistInfoTimeToLive) viper.SetDefault("devartistinfotimetolive", consts.ArtistInfoTimeToLive)
viper.SetDefault("devalbuminfotimetolive", consts.AlbumInfoTimeToLive) viper.SetDefault("devalbuminfotimetolive", consts.AlbumInfoTimeToLive)
viper.SetDefault("devexternalscanner", true) viper.SetDefault("devexternalscanner", true)