Merge pull request #223 from muff1nman/booter-cleanup

Remove installation from project
This commit is contained in:
Tom Powell
2017-01-18 23:18:35 -08:00
committed by GitHub
84 changed files with 1 additions and 5690 deletions
@@ -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();
}
}
}
@@ -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>();