Remove installation from project
Signed-off-by: Andrew DeMaria <lostonamountain@gmail.com>
This commit is contained in:
@@ -1,35 +1,9 @@
|
||||
package org.libresonic.player.controller;
|
||||
|
||||
import org.apache.commons.lang.ObjectUtils;
|
||||
import org.libresonic.player.service.SettingsService;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* This class has been created to refactor code previously present
|
||||
* in the MultiController.
|
||||
*/
|
||||
public class ControllerUtils {
|
||||
|
||||
public static void updatePortAndContextPath(HttpServletRequest request, SettingsService settingsService) {
|
||||
|
||||
int port = Integer.parseInt(System.getProperty("libresonic.port", String.valueOf(request.getLocalPort())));
|
||||
int httpsPort = Integer.parseInt(System.getProperty("libresonic.httpsPort", "0"));
|
||||
|
||||
String contextPath = request.getContextPath().replace("/", "");
|
||||
|
||||
if (settingsService.getPort() != port) {
|
||||
settingsService.setPort(port);
|
||||
settingsService.save();
|
||||
}
|
||||
if (settingsService.getHttpsPort() != httpsPort) {
|
||||
settingsService.setHttpsPort(httpsPort);
|
||||
settingsService.save();
|
||||
}
|
||||
if (!ObjectUtils.equals(settingsService.getUrlRedirectContextPath(), contextPath)) {
|
||||
settingsService.setUrlRedirectContextPath(contextPath);
|
||||
settingsService.save();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-1
@@ -41,7 +41,6 @@ public class GettingStartedController {
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET)
|
||||
public ModelAndView gettingStarted(HttpServletRequest request) {
|
||||
ControllerUtils.updatePortAndContextPath(request,settingsService);
|
||||
|
||||
if (request.getParameter("hide") != null) {
|
||||
settingsService.setGettingStartedEnabled(false);
|
||||
|
||||
@@ -29,7 +29,6 @@ public class IndexController {
|
||||
|
||||
@RequestMapping(method = { RequestMethod.GET})
|
||||
public ModelAndView index(HttpServletRequest request) {
|
||||
ControllerUtils.updatePortAndContextPath(request,settingsService);
|
||||
UserSettings userSettings = settingsService.getUserSettings(securityService.getCurrentUsername(request));
|
||||
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
|
||||
Reference in New Issue
Block a user