feat(server/m7-363): thread BrandingConfig through server.New

This commit is contained in:
2026-05-03 17:17:52 -04:00
parent cd50ffd77d
commit 46ea9a761a
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -109,7 +109,7 @@ func run() error {
srv := server.New(logger, pool, scanner, subsonic.Config{
AllowPlaintextPassword: cfg.Subsonic.AllowPlaintextPassword,
}, cfg.Events, cfg.Recommendation, cfg.Storage.DataDir)
}, cfg.Events, cfg.Recommendation, cfg.Storage.DataDir, cfg.Branding)
httpServer := &http.Server{
Addr: cfg.Server.Address,
Handler: srv.Router(),
+4 -3
View File
@@ -67,11 +67,12 @@ type Server struct {
// playlist cover collages under <DataDir>/playlist_covers/). Empty
// strings are tolerated by tests that don't exercise persisted-cover
// codepaths; production callers should pass a writable directory.
DataDir string
DataDir string
BrandingCfg config.BrandingConfig
}
func New(logger *slog.Logger, pool *pgxpool.Pool, scanner ScanTrigger, subCfg subsonic.Config, eventsCfg config.EventsConfig, recCfg config.RecommendationConfig, dataDir string) *Server {
return &Server{Logger: logger, Pool: pool, Scanner: scanner, SubsonicCfg: subCfg, EventsCfg: eventsCfg, RecommendationCfg: recCfg, DataDir: dataDir}
func New(logger *slog.Logger, pool *pgxpool.Pool, scanner ScanTrigger, subCfg subsonic.Config, eventsCfg config.EventsConfig, recCfg config.RecommendationConfig, dataDir string, brandingCfg config.BrandingConfig) *Server {
return &Server{Logger: logger, Pool: pool, Scanner: scanner, SubsonicCfg: subCfg, EventsCfg: eventsCfg, RecommendationCfg: recCfg, DataDir: dataDir, BrandingCfg: brandingCfg}
}
func (s *Server) Router() http.Handler {