From 48852e081a374c495fec1162f4dce3f31dc5b2c0 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Mon, 21 Feb 2022 22:39:59 +0100 Subject: Delete a few unused things --- .../net/sync/gpoddernet/GpodnetService.java | 73 ---------------------- 1 file changed, 73 deletions(-) (limited to 'net/sync') 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 21a362a40..7c0d7cb51 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 @@ -19,7 +19,6 @@ import java.net.URISyntaxException; import java.net.URL; import java.nio.charset.Charset; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Locale; @@ -212,45 +211,6 @@ public class GpodnetService implements ISyncService { } } - /** - * Returns synchronization status of devices. - *

- * This method requires authentication. - * - * @throws GpodnetServiceAuthenticationException If there is an authentication error. - */ - public List> getSynchronizedDevices() throws GpodnetServiceException { - requireLoggedIn(); - try { - URL url = new URI(baseScheme, null, baseHost, basePort, - String.format("/api/2/sync-devices/%s.json", username), null, null).toURL(); - Request.Builder request = new Request.Builder().url(url); - String response = executeRequest(request); - JSONObject syncStatus = new JSONObject(response); - List> result = new ArrayList<>(); - - JSONArray synchronizedDevices = syncStatus.getJSONArray("synchronized"); - for (int i = 0; i < synchronizedDevices.length(); i++) { - JSONArray groupDevices = synchronizedDevices.getJSONArray(i); - List group = new ArrayList<>(); - for (int j = 0; j < groupDevices.length(); j++) { - group.add(groupDevices.getString(j)); - } - result.add(group); - } - - JSONArray notSynchronizedDevices = syncStatus.getJSONArray("not-synchronized"); - for (int i = 0; i < notSynchronizedDevices.length(); i++) { - result.add(Collections.singletonList(notSynchronizedDevices.getString(i))); - } - - return result; - } catch (JSONException | MalformedURLException | URISyntaxException e) { - e.printStackTrace(); - throw new GpodnetServiceException(e); - } - } - /** * Configures the device of a given user. *

@@ -287,39 +247,6 @@ public class GpodnetService implements ISyncService { } } - /** - * Links devices for synchronization. - *

- * This method requires authentication. - * - * @throws GpodnetServiceAuthenticationException If there is an authentication error. - */ - public void linkDevices(@NonNull List deviceIds) throws GpodnetServiceException { - requireLoggedIn(); - try { - final URL url = new URI(baseScheme, null, baseHost, basePort, - String.format("/api/2/sync-devices/%s.json", username), null, null).toURL(); - JSONObject jsonContent = new JSONObject(); - JSONArray group = new JSONArray(); - for (String deviceId : deviceIds) { - group.put(deviceId); - } - - JSONArray synchronizedGroups = new JSONArray(); - synchronizedGroups.put(group); - jsonContent.put("synchronize", synchronizedGroups); - jsonContent.put("stop-synchronize", new JSONArray()); - - Log.d("aaaa", jsonContent.toString()); - RequestBody body = RequestBody.create(JSON, jsonContent.toString()); - Request.Builder request = new Request.Builder().post(body).url(url); - executeRequest(request); - } catch (JSONException | MalformedURLException | URISyntaxException e) { - e.printStackTrace(); - throw new GpodnetServiceException(e); - } - } - /** * Uploads the subscriptions of a specific device. *

-- cgit v1.2.3