From 0916ab1aac245f8c5b94501fd19e0a0a13f69082 Mon Sep 17 00:00:00 2001 From: Andrew DeMaria Date: Wed, 3 May 2017 17:18:43 -0600 Subject: [PATCH] Dont mix ws and normal HttpServletRequest retrieval methods Signed-off-by: Andrew DeMaria --- .../player/controller/SonosSettingsController.java | 5 +++-- .../java/org/libresonic/player/service/SonosService.java | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libresonic-main/src/main/java/org/libresonic/player/controller/SonosSettingsController.java b/libresonic-main/src/main/java/org/libresonic/player/controller/SonosSettingsController.java index a83bbc12..c52e399d 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/controller/SonosSettingsController.java +++ b/libresonic-main/src/main/java/org/libresonic/player/controller/SonosSettingsController.java @@ -19,6 +19,7 @@ package org.libresonic.player.controller; import org.apache.commons.lang.StringUtils; +import org.libresonic.player.service.NetworkService; import org.libresonic.player.service.SettingsService; import org.libresonic.player.service.SonosService; import org.springframework.beans.factory.annotation.Autowired; @@ -80,8 +81,8 @@ public class SonosSettingsController { settingsService.setSonosServiceName(sonosServiceName); settingsService.save(); - sonosService.setMusicServiceEnabled(false); - sonosService.setMusicServiceEnabled(sonosEnabled); + sonosService.setMusicServiceEnabled(false, NetworkService.getBaseUrl(request)); + sonosService.setMusicServiceEnabled(sonosEnabled, NetworkService.getBaseUrl(request)); } public void setSettingsService(SettingsService settingsService) { diff --git a/libresonic-main/src/main/java/org/libresonic/player/service/SonosService.java b/libresonic-main/src/main/java/org/libresonic/player/service/SonosService.java index 314d330d..4c7aa623 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/service/SonosService.java +++ b/libresonic-main/src/main/java/org/libresonic/player/service/SonosService.java @@ -106,7 +106,7 @@ public class SonosService implements SonosSoap { @Resource private WebServiceContext context; - public void setMusicServiceEnabled(boolean enabled) { + public void setMusicServiceEnabled(boolean enabled, String baseUrl) { List sonosControllers = upnpService.getSonosControllerHosts(); if (sonosControllers.isEmpty()) { LOG.info("No Sonos controller found"); @@ -116,11 +116,10 @@ public class SonosService implements SonosSoap { String sonosServiceName = settingsService.getSonosServiceName(); int sonosServiceId = settingsService.getSonosServiceId(); - String libresonicBaseUrl = NetworkService.getBaseUrl(getRequest()); for (String sonosController : sonosControllers) { try { - new SonosServiceRegistration().setEnabled(libresonicBaseUrl, sonosController, enabled, + new SonosServiceRegistration().setEnabled(baseUrl, sonosController, enabled, sonosServiceName, sonosServiceId); break; } catch (IOException x) {