()
| 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') |
no test coverage detected