MCPcopy
hub / github.com/agalwood/Motrix / watchUPnPEnabledChange

Method watchUPnPEnabledChange

src/main/Application.js:374–386  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

372 }
373
374 watchUPnPEnabledChange () {
375 const { userConfig } = this.configManager
376 const key = 'enable-upnp'
377 this.configListeners[key] = userConfig.onDidChange(key, async (newValue, oldValue) => {
378 logger.info('[Motrix] detected enable-upnp value change event:', newValue, oldValue)
379 if (newValue) {
380 this.startUPnPMapping()
381 } else {
382 await this.stopUPnPMapping()
383 this.upnp.closeClient()
384 }
385 })
386 }
387
388 async shutdownUPnPManager () {
389 const enable = this.configManager.getUserConfig('enable-upnp')

Callers 1

initUPnPManagerMethod · 0.95

Calls 3

startUPnPMappingMethod · 0.95
stopUPnPMappingMethod · 0.95
closeClientMethod · 0.45

Tested by

no test coverage detected