From e06d9dbc222f873bba51717ae468abbc09cb49f2 Mon Sep 17 00:00:00 2001 From: Zak Peirce Date: Fri, 16 Dec 2016 11:50:44 -0800 Subject: [PATCH] Removed the rest of the license, now builds --- .../controller/NetworkSettingsController.java | 3 +- .../libresonic/player/domain/LicenseInfo.java | 89 ------------------- .../RESTRequestParameterProcessingFilter.java | 1 - .../player/service/NetworkService.java | 1 - .../player/service/SettingsService.java | 3 +- 5 files changed, 3 insertions(+), 94 deletions(-) delete mode 100644 libresonic-main/src/main/java/org/libresonic/player/domain/LicenseInfo.java diff --git a/libresonic-main/src/main/java/org/libresonic/player/controller/NetworkSettingsController.java b/libresonic-main/src/main/java/org/libresonic/player/controller/NetworkSettingsController.java index ed341e94..bb105996 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/controller/NetworkSettingsController.java +++ b/libresonic-main/src/main/java/org/libresonic/player/controller/NetworkSettingsController.java @@ -56,7 +56,6 @@ public class NetworkSettingsController { command.setUrlRedirectFrom(settingsService.getUrlRedirectFrom()); command.setUrlRedirectCustomUrl(settingsService.getUrlRedirectCustomUrl()); command.setPort(settingsService.getPort()); - command.setLicenseInfo(settingsService.getLicenseInfo()); model.addAttribute("command",command); } @@ -86,4 +85,4 @@ public class NetworkSettingsController { return "networkSettings"; } -} \ No newline at end of file +} diff --git a/libresonic-main/src/main/java/org/libresonic/player/domain/LicenseInfo.java b/libresonic-main/src/main/java/org/libresonic/player/domain/LicenseInfo.java deleted file mode 100644 index ca56766a..00000000 --- a/libresonic-main/src/main/java/org/libresonic/player/domain/LicenseInfo.java +++ /dev/null @@ -1,89 +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.domain; - -import java.util.Date; - -import org.apache.commons.lang.StringUtils; - -import org.libresonic.player.service.SettingsService; - -/** - * Controller for the "Podcast receiver" page. - * - * @author Sindre Mehus - */ -public class LicenseInfo { - - private String licenseEmail; - private boolean licenseValid; - private final Date trialExpires; - private long trialDaysLeft; - private final Date licenseExpires; - - public LicenseInfo(String licenseEmail, boolean licenseValid, Date trialExpires, - long trialDaysLeft, Date licenseExpires) { - this.licenseEmail = licenseEmail; - this.licenseValid = licenseValid; - this.trialExpires = trialExpires; - this.trialDaysLeft = trialDaysLeft; - this.licenseExpires = licenseExpires; - } - - public String getLicenseEmail() { - return licenseEmail; - } - - public void setLicenseEmail(String licenseEmail) { - this.licenseEmail = StringUtils.trimToNull(licenseEmail); - } - - public boolean isLicenseValid() { - return licenseValid; - } - - public void setLicenseValid(boolean licenseValid) { - this.licenseValid = licenseValid; - } - - public boolean isTrial() { - return trialExpires != null && !licenseValid; - } - - public boolean isTrialExpired() { - return trialExpires != null && (trialExpires.before(new Date()) || trialDaysLeft > SettingsService.TRIAL_DAYS + 1); - } - - public boolean isLicenseOrTrialValid() { - return isLicenseValid() || !isTrialExpired(); - } - - public Date getTrialExpires() { - return trialExpires; - } - - public long getTrialDaysLeft() { - return trialDaysLeft; - } - - public Date getLicenseExpires() { - return licenseExpires; - } -} diff --git a/libresonic-main/src/main/java/org/libresonic/player/security/RESTRequestParameterProcessingFilter.java b/libresonic-main/src/main/java/org/libresonic/player/security/RESTRequestParameterProcessingFilter.java index dfabd4eb..f5274148 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/security/RESTRequestParameterProcessingFilter.java +++ b/libresonic-main/src/main/java/org/libresonic/player/security/RESTRequestParameterProcessingFilter.java @@ -24,7 +24,6 @@ import org.apache.commons.lang.StringUtils; import org.libresonic.player.Logger; import org.libresonic.player.controller.JAXBWriter; import org.libresonic.player.controller.RESTController; -import org.libresonic.player.domain.LicenseInfo; import org.libresonic.player.domain.User; import org.libresonic.player.domain.Version; import org.libresonic.player.service.SecurityService; 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 aaaeb0a3..1d0d89e3 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 @@ -240,7 +240,6 @@ public class NetworkService { params.add(new BasicNameValuePair("localIp", settingsService.getLocalIpAddress())); params.add(new BasicNameValuePair("localPort", String.valueOf(port))); params.add(new BasicNameValuePair("contextPath", settingsService.getUrlRedirectContextPath())); - } diff --git a/libresonic-main/src/main/java/org/libresonic/player/service/SettingsService.java b/libresonic-main/src/main/java/org/libresonic/player/service/SettingsService.java index 132b39a0..1f7185b7 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/service/SettingsService.java +++ b/libresonic-main/src/main/java/org/libresonic/player/service/SettingsService.java @@ -236,6 +236,7 @@ public class SettingsService { private static File libresonicHome; + private static final long LOCAL_IP_LOOKUP_DELAY_SECONDS = 60; private String localIpAddress; public SettingsService() { @@ -261,6 +262,7 @@ public class SettingsService { } } } + } /** @@ -1331,7 +1333,6 @@ public class SettingsService { localIpAddress = Util.getLocalIpAddress(); } }; - executor.scheduleWithFixedDelay(task, 0L, LOCAL_IP_LOOKUP_DELAY_SECONDS, TimeUnit.SECONDS); } public void setInternetRadioDao(InternetRadioDao internetRadioDao) {