Removed gpodder suggestions feature
The feature was invisible since 2014 and nobody noticed.
This commit is contained in:
parent
85c8a419ac
commit
a7d280d249
@ -74,20 +74,6 @@ public class GPodnetServiceTest {
|
||||
service.getSubscriptionChanges(1362322610L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetSubscriptionsOfUser()
|
||||
throws GpodnetServiceException {
|
||||
authenticate();
|
||||
service.getSubscriptionsOfUser();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetSubscriptionsOfDevice()
|
||||
throws GpodnetServiceException {
|
||||
authenticate();
|
||||
service.getSubscriptionsOfDevice(DEVICE_ID);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConfigureDevices() throws GpodnetServiceException {
|
||||
authenticate();
|
||||
@ -100,12 +86,6 @@ public class GPodnetServiceTest {
|
||||
service.getDevices();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetSuggestions() throws GpodnetServiceException {
|
||||
authenticate();
|
||||
service.getSuggestions(10);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTags() throws GpodnetServiceException {
|
||||
service.getTopTags(20);
|
||||
|
@ -30,7 +30,6 @@ public class GpodnetMainFragment extends Fragment {
|
||||
private static final int NUM_PAGES = 2;
|
||||
private static final int POS_TOPLIST = 0;
|
||||
private static final int POS_TAGS = 1;
|
||||
private static final int POS_SUGGESTIONS = 2;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
@ -50,12 +49,9 @@ public class GpodnetMainFragment extends Fragment {
|
||||
case POS_TAGS:
|
||||
tab.setText(R.string.gpodnet_taglist_header);
|
||||
break;
|
||||
case POS_TOPLIST:
|
||||
tab.setText(R.string.gpodnet_toplist_header);
|
||||
break;
|
||||
case POS_TOPLIST: // Fall-through
|
||||
default:
|
||||
case POS_SUGGESTIONS:
|
||||
tab.setText(R.string.gpodnet_suggestions_header);
|
||||
tab.setText(R.string.gpodnet_toplist_header);
|
||||
break;
|
||||
}
|
||||
}).attach();
|
||||
@ -102,11 +98,9 @@ public class GpodnetMainFragment extends Fragment {
|
||||
switch (position) {
|
||||
case POS_TAGS:
|
||||
return new TagListFragment();
|
||||
case POS_TOPLIST:
|
||||
return new PodcastTopListFragment();
|
||||
case POS_TOPLIST: // Fall-through
|
||||
default:
|
||||
case POS_SUGGESTIONS:
|
||||
return new SuggestionListFragment();
|
||||
return new PodcastTopListFragment();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,26 +0,0 @@
|
||||
package de.danoeh.antennapod.fragment.gpodnet;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import de.danoeh.antennapod.core.preferences.GpodnetPreferences;
|
||||
import de.danoeh.antennapod.net.sync.gpoddernet.GpodnetService;
|
||||
import de.danoeh.antennapod.net.sync.gpoddernet.GpodnetServiceException;
|
||||
import de.danoeh.antennapod.net.sync.gpoddernet.model.GpodnetPodcast;
|
||||
|
||||
/**
|
||||
* Displays suggestions from gpodder.net
|
||||
*/
|
||||
public class SuggestionListFragment extends PodcastListFragment {
|
||||
private static final int SUGGESTIONS_COUNT = 50;
|
||||
|
||||
@Override
|
||||
protected List<GpodnetPodcast> loadPodcastData(GpodnetService service) throws GpodnetServiceException {
|
||||
if (GpodnetPreferences.loggedIn()) {
|
||||
service.login();
|
||||
return service.getSuggestions(SUGGESTIONS_COUNT);
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
}
|
@ -630,7 +630,6 @@
|
||||
<!-- gpodder.net -->
|
||||
<string name="gpodnet_taglist_header">CATEGORIES</string>
|
||||
<string name="gpodnet_toplist_header">TOP PODCASTS</string>
|
||||
<string name="gpodnet_suggestions_header">SUGGESTIONS</string>
|
||||
<string name="gpodnet_search_hint">Search gpodder.net</string>
|
||||
<string name="gpodnetauth_login_butLabel">Login</string>
|
||||
<string name="gpodnetauth_encryption_warning">Password and data are not encrypted!</string>
|
||||
|
@ -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.
|
||||
* <p/>
|
||||
* 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<GpodnetPodcast> 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.
|
||||
* <p/>
|
||||
* 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.
|
||||
* <p/>
|
||||
* 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.
|
||||
* <p/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user