diff --git a/libresonic-main/src/main/java/org/libresonic/player/ajax/MultiService.java b/libresonic-main/src/main/java/org/libresonic/player/ajax/MultiService.java index d2d83e21..97827157 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/ajax/MultiService.java +++ b/libresonic-main/src/main/java/org/libresonic/player/ajax/MultiService.java @@ -45,24 +45,11 @@ public class MultiService { private static final Logger LOG = Logger.getLogger(MultiService.class); - private NetworkService networkService; private MediaFileService mediaFileService; private LastFmService lastFmService; private SecurityService securityService; private SettingsService settingsService; - /** - * Returns status for port forwarding and URL redirection. - */ - public NetworkStatus getNetworkStatus() { - NetworkService.Status portForwardingStatus = networkService.getPortForwardingStatus(); - NetworkService.Status urlRedirectionStatus = networkService.getURLRedirecionStatus(); - return new NetworkStatus(portForwardingStatus.getText(), - portForwardingStatus.getDate(), - urlRedirectionStatus.getText(), - urlRedirectionStatus.getDate()); - } - public ArtistInfo getArtistInfo(int mediaFileId, int maxSimilarArtists, int maxTopSongs) { MediaFile mediaFile = mediaFileService.getMediaFile(mediaFileId); List similarArtists = getSimilarArtists(mediaFileId, maxSimilarArtists); @@ -111,10 +98,6 @@ public class MultiService { settingsService.updateUserSettings(userSettings); } - public void setNetworkService(NetworkService networkService) { - this.networkService = networkService; - } - public void setMediaFileService(MediaFileService mediaFileService) { this.mediaFileService = mediaFileService; } diff --git a/libresonic-main/src/main/java/org/libresonic/player/ajax/NetworkStatus.java b/libresonic-main/src/main/java/org/libresonic/player/ajax/NetworkStatus.java deleted file mode 100644 index 2e1c3355..00000000 --- a/libresonic-main/src/main/java/org/libresonic/player/ajax/NetworkStatus.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - This file is part of Libresonic. - - Libresonic is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Libresonic is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Libresonic. If not, see . - - Copyright 2016 (C) Libresonic Authors - Based upon Subsonic, Copyright 2009 (C) Sindre Mehus - */ -package org.libresonic.player.ajax; - -import java.util.Date; - -/** - * @author Sindre Mehus - */ -public class NetworkStatus { - private final String portForwardingStatusText; - private final Date portForwardingStatusDate; - private final String urlRedirectionStatusText; - private final Date urlRedirectionStatusDate; - - public NetworkStatus(String portForwardingStatusText, Date portForwardingStatusDate, - String urlRedirectionStatusText, Date urlRedirectionStatusDate) { - this.portForwardingStatusText = portForwardingStatusText; - this.portForwardingStatusDate = portForwardingStatusDate; - this.urlRedirectionStatusText = urlRedirectionStatusText; - this.urlRedirectionStatusDate = urlRedirectionStatusDate; - } - - public String getPortForwardingStatusText() { - return portForwardingStatusText; - } - - public Date getPortForwardingStatusDate() { - return portForwardingStatusDate; - } - - public String getUrlRedirectionStatusText() { - return urlRedirectionStatusText; - } - - public Date getUrlRedirectionStatusDate() { - return urlRedirectionStatusDate; - } -} diff --git a/libresonic-main/src/main/java/org/libresonic/player/service/NetworkService.java b/libresonic-main/src/main/java/org/libresonic/player/service/NetworkService.java index 0b5f6f78..c3c1d663 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/service/NetworkService.java +++ b/libresonic-main/src/main/java/org/libresonic/player/service/NetworkService.java @@ -27,55 +27,9 @@ import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; -import java.util.Date; -/** - * Provides network-related services, including port forwarding on UPnP routers and - * URL redirection from http://xxxx.libresonic.org. - * - * @author Sindre Mehus - */ public class NetworkService { - public static final String NOT_SUPPORTED = "NOT SUPPORTED"; - - private final static Status portForwardingStatus; - private final static Status urlRedirectionStatus; - - static { - portForwardingStatus = new Status(); - portForwardingStatus.setText(NOT_SUPPORTED); - urlRedirectionStatus = new Status(); - urlRedirectionStatus.setText(NOT_SUPPORTED); - } - - public Status getPortForwardingStatus() { - return portForwardingStatus; - } - - public Status getURLRedirecionStatus() { - return urlRedirectionStatus; - } - - public static class Status { - - private String text; - private Date date; - - public void setText(String text) { - this.text = text; - date = new Date(); - } - - public String getText() { - return text; - } - - public Date getDate() { - return date; - } - } - public static String getBaseUrl(HttpServletRequest request) { try { UrlPathHelper urlPathHelper = new UrlPathHelper(); diff --git a/libresonic-main/src/main/resources/applicationContext-service.xml b/libresonic-main/src/main/resources/applicationContext-service.xml index defe4cce..44f3aabe 100644 --- a/libresonic-main/src/main/resources/applicationContext-service.xml +++ b/libresonic-main/src/main/resources/applicationContext-service.xml @@ -235,7 +235,6 @@ - diff --git a/libresonic-main/src/main/webapp/WEB-INF/dwr.xml b/libresonic-main/src/main/webapp/WEB-INF/dwr.xml index 05bdc66b..13c4b67c 100644 --- a/libresonic-main/src/main/webapp/WEB-INF/dwr.xml +++ b/libresonic-main/src/main/webapp/WEB-INF/dwr.xml @@ -40,7 +40,6 @@ -