Manager: actually respect autodiscoverable: false in configuration

The Manager configuration has an option to disable the UPnP/SSDP server,
and now it actually listens to it.
This commit is contained in:
Sybren A. Stüvel 2024-08-01 13:47:52 +02:00
parent 3f86364fa4
commit b68e51976d

View File

@ -148,7 +148,13 @@ func runFlamencoManager() bool {
log.Fatal().Err(err).Msg("unable to figure out my own URL")
}
ssdp := makeAutoDiscoverable(urls)
// Construct the UPnP/SSDP server.
var ssdp *upnp_ssdp.Server
if configService.Get().SSDPDiscovery {
ssdp = makeAutoDiscoverable(urls)
} else {
log.Debug().Msg("UPnP/SSDP autodiscovery disabled in configuration")
}
// Construct the services.
persist := openDB(*configService)