feat(server/m7-353): config + main.go wiring for coverart enricher
This commit is contained in:
@@ -69,8 +69,11 @@ type AdminBootstrapConfig struct {
|
||||
}
|
||||
|
||||
type LibraryConfig struct {
|
||||
ScanPaths []string `yaml:"scan_paths"`
|
||||
ScanOnStartup bool `yaml:"scan_on_startup"`
|
||||
ScanPaths []string `yaml:"scan_paths"`
|
||||
ScanOnStartup bool `yaml:"scan_on_startup"`
|
||||
CoverArtFromMBCAA bool `yaml:"coverart_from_mbcaa"` // default true
|
||||
CoverArtBackfillCap int `yaml:"coverart_backfill_cap"` // default 500
|
||||
ContactEmail string `yaml:"contact_email"` // optional override for MBCAA UA
|
||||
}
|
||||
|
||||
// SubsonicConfig controls wire-format concessions on the /rest/* surface.
|
||||
@@ -134,6 +137,10 @@ func Default() Config {
|
||||
RadioSize: 50,
|
||||
RadioSizeMax: 200,
|
||||
},
|
||||
Library: LibraryConfig{
|
||||
CoverArtFromMBCAA: true,
|
||||
CoverArtBackfillCap: 500,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,6 +196,19 @@ func applyEnv(cfg *Config) {
|
||||
cfg.Library.ScanOnStartup = b
|
||||
}
|
||||
}
|
||||
if v, ok := os.LookupEnv("MINSTREL_LIBRARY_COVERART_FROM_MBCAA"); ok {
|
||||
if b, err := strconv.ParseBool(v); err == nil {
|
||||
cfg.Library.CoverArtFromMBCAA = b
|
||||
}
|
||||
}
|
||||
if v, ok := os.LookupEnv("MINSTREL_LIBRARY_COVERART_BACKFILL_CAP"); ok {
|
||||
if n, err := strconv.Atoi(v); err == nil {
|
||||
cfg.Library.CoverArtBackfillCap = n
|
||||
}
|
||||
}
|
||||
if v, ok := os.LookupEnv("MINSTREL_CONTACT_EMAIL"); ok {
|
||||
cfg.Library.ContactEmail = v
|
||||
}
|
||||
if v, ok := os.LookupEnv("MINSTREL_SUBSONIC_ALLOW_PLAINTEXT_PASSWORD"); ok {
|
||||
if b, err := strconv.ParseBool(v); err == nil {
|
||||
cfg.Subsonic.AllowPlaintextPassword = b
|
||||
|
||||
Reference in New Issue
Block a user