From a7d280d249c6806972a194c93d76ece46f5f41c7 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 27 Aug 2021 23:21:17 +0200 Subject: Removed gpodder suggestions feature The feature was invisible since 2014 and nobody noticed. --- .../net/sync/gpoddernet/GpodnetService.java | 79 +--------------------- 1 file changed, 2 insertions(+), 77 deletions(-) (limited to 'net') diff --git a/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/gpoddernet/GpodnetService.java b/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/gpoddernet/GpodnetService.java index d41f613a7..eb18da80b 100644 --- a/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/gpoddernet/GpodnetService.java +++ b/net/sync/gpoddernet/src/main/java/de/danoeh/antennapod/net/sync/gpoddernet/GpodnetService.java @@ -62,7 +62,7 @@ public class GpodnetService implements ISyncService { private final OkHttpClient httpClient; // split into schema, host and port - missing parts are null - private static Pattern urlsplit_regex = Pattern.compile("(?:(https?)://)?([^:]+)(?::(\\d+))?"); + private static final Pattern URLSPLIT_REGEX = Pattern.compile("(?:(https?)://)?([^:]+)(?::(\\d+))?"); public GpodnetService(OkHttpClient httpClient, String baseHosturl, String deviceId, String username, String password) { @@ -71,7 +71,7 @@ public class GpodnetService implements ISyncService { this.username = username; this.password = password; - Matcher m = urlsplit_regex.matcher(baseHosturl); + Matcher m = URLSPLIT_REGEX.matcher(baseHosturl); if (m.matches()) { this.baseScheme = m.group(1); this.baseHost = m.group(2); @@ -186,37 +186,6 @@ public class GpodnetService implements ISyncService { } } - /** - * Returns a list of suggested podcasts for the user that is currently - * logged in. - *

- * This method requires authentication. - * - * @param count The - * number of elements that should be returned. Must be in range - * 1..100. - * @throws IllegalArgumentException if count is out of range. - * @throws GpodnetServiceAuthenticationException If there is an authentication error. - */ - public List getSuggestions(int count) throws GpodnetServiceException { - if (count < 1 || count > 100) { - throw new IllegalArgumentException("Count must be in range 1..100"); - } - - try { - URL url = new URI(baseScheme, null, baseHost, basePort, - String.format(Locale.US, "/suggestions/%d.json", count), null, null).toURL(); - Request.Builder request = new Request.Builder().url(url); - String response = executeRequest(request); - - JSONArray jsonArray = new JSONArray(response); - return readPodcastListFromJsonArray(jsonArray); - } catch (JSONException | MalformedURLException | URISyntaxException e) { - e.printStackTrace(); - throw new GpodnetServiceException(e); - } - } - /** * Searches the podcast directory for a given string. * @@ -377,50 +346,6 @@ public class GpodnetService implements ISyncService { } } - /** - * Returns the subscriptions of a specific device. - *

- * This method requires authentication. - * - * @param deviceId The ID of the device whose subscriptions should be returned. - * @return A list of subscriptions in OPML format. - * @throws GpodnetServiceAuthenticationException If there is an authentication error. - */ - public String getSubscriptionsOfDevice(@NonNull String deviceId) throws GpodnetServiceException { - requireLoggedIn(); - try { - URL url = new URI(baseScheme, null, baseHost, basePort, - String.format("/subscriptions/%s/%s.opml", username, deviceId), null, null).toURL(); - Request.Builder request = new Request.Builder().url(url); - return executeRequest(request); - } catch (MalformedURLException | URISyntaxException e) { - e.printStackTrace(); - throw new GpodnetServiceException(e); - } - } - - /** - * Returns all subscriptions of a specific user. - *

- * This method requires authentication. - * - * @return A list of subscriptions in OPML format. - * @throws IllegalArgumentException If username is null. - * @throws GpodnetServiceAuthenticationException If there is an authentication error. - */ - public String getSubscriptionsOfUser() throws GpodnetServiceException { - requireLoggedIn(); - try { - URL url = new URI(baseScheme, null, baseHost, basePort, - String.format("/subscriptions/%s.opml", username), null, null).toURL(); - Request.Builder request = new Request.Builder().url(url); - return executeRequest(request); - } catch (MalformedURLException | URISyntaxException e) { - e.printStackTrace(); - throw new GpodnetServiceException(e); - } - } - /** * Uploads the subscriptions of a specific device. *

-- cgit v1.2.3