diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java index 4d1848296..8fe5e1c18 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java @@ -34,7 +34,6 @@ import de.danoeh.antennapod.databinding.AddfeedBinding; import de.danoeh.antennapod.databinding.EditTextDialogBinding; import de.danoeh.antennapod.net.discovery.CombinedSearcher; import de.danoeh.antennapod.net.discovery.FyydPodcastSearcher; -import de.danoeh.antennapod.net.discovery.GpodnetPodcastSearcher; import de.danoeh.antennapod.net.discovery.ItunesPodcastSearcher; import de.danoeh.antennapod.net.discovery.PodcastIndexPodcastSearcher; import de.danoeh.antennapod.ui.appstartintent.OnlineFeedviewActivityStarter; @@ -81,8 +80,6 @@ public class AddFeedFragment extends Fragment { -> activity.loadChildFragment(OnlineSearchFragment.newInstance(ItunesPodcastSearcher.class))); viewBinding.searchFyydButton.setOnClickListener(v -> activity.loadChildFragment(OnlineSearchFragment.newInstance(FyydPodcastSearcher.class))); - viewBinding.searchGPodderButton.setOnClickListener(v - -> activity.loadChildFragment(OnlineSearchFragment.newInstance(GpodnetPodcastSearcher.class))); viewBinding.searchPodcastIndexButton.setOnClickListener(v -> activity.loadChildFragment(OnlineSearchFragment.newInstance(PodcastIndexPodcastSearcher.class))); diff --git a/app/src/main/res/layout/addfeed.xml b/app/src/main/res/layout/addfeed.xml index d3e3c3c1d..f4455afd2 100644 --- a/app/src/main/res/layout/addfeed.xml +++ b/app/src/main/res/layout/addfeed.xml @@ -133,15 +133,6 @@ app:drawableLeftCompat="@drawable/ic_search" style="@style/AddPodcastTextView" /> - - > search(String query) { - return Single.create((SingleOnSubscribe>) subscriber -> { - try { - GpodnetService service = new GpodnetService(AntennapodHttpClient.getHttpClient(), - SynchronizationCredentials.getHosturl(), SynchronizationCredentials.getDeviceId(), - SynchronizationCredentials.getUsername(), SynchronizationCredentials.getPassword()); - List gpodnetPodcasts = service.searchPodcasts(query, 0); - List results = new ArrayList<>(); - for (GpodnetPodcast podcast : gpodnetPodcasts) { - results.add(PodcastSearchResult.fromGpodder(podcast)); - } - subscriber.onSuccess(results); - } catch (GpodnetServiceException e) { - e.printStackTrace(); - subscriber.onError(e); - } - }) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()); - } - - @Override - public Single lookupUrl(String url) { - return Single.just(url); - } - - @Override - public boolean urlNeedsLookup(String url) { - return false; - } - - @Override - public String getName() { - return "Gpodder.net"; - } -} diff --git a/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/PodcastSearchResult.java b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/PodcastSearchResult.java index b3f352334..db33d2ce7 100644 --- a/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/PodcastSearchResult.java +++ b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/PodcastSearchResult.java @@ -1,7 +1,6 @@ package de.danoeh.antennapod.net.discovery; import androidx.annotation.Nullable; -import de.danoeh.antennapod.net.sync.gpoddernet.model.GpodnetPodcast; import de.mfietz.fyydlin.SearchHit; import org.json.JSONArray; import org.json.JSONException; @@ -93,13 +92,6 @@ public class PodcastSearchResult { searchHit.getAuthor()); } - public static PodcastSearchResult fromGpodder(GpodnetPodcast searchHit) { - return new PodcastSearchResult(searchHit.getTitle(), - searchHit.getLogoUrl(), - searchHit.getUrl(), - searchHit.getAuthor()); - } - public static PodcastSearchResult fromPodcastIndex(JSONObject json) { String title = json.optString("title", ""); String imageUrl = json.optString("image", null); diff --git a/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/PodcastSearcherRegistry.java b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/PodcastSearcherRegistry.java index c7892bd09..2d8c2ae38 100644 --- a/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/PodcastSearcherRegistry.java +++ b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/PodcastSearcherRegistry.java @@ -15,7 +15,6 @@ public class PodcastSearcherRegistry { if (searchProviders == null) { searchProviders = new ArrayList<>(); searchProviders.add(new SearcherInfo(new CombinedSearcher(), 1.0f)); - searchProviders.add(new SearcherInfo(new GpodnetPodcastSearcher(), 0.0f)); searchProviders.add(new SearcherInfo(new FyydPodcastSearcher(), 1.0f)); searchProviders.add(new SearcherInfo(new ItunesPodcastSearcher(), 1.0f)); searchProviders.add(new SearcherInfo(new PodcastIndexPodcastSearcher(), 1.0f)); 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 cfa915ffa..c65e654aa 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 @@ -78,36 +78,6 @@ public class GpodnetService implements ISyncService { } } - /** - * Searches the podcast directory for a given string. - * - * @param query The search query - * @param scaledLogoSize The size of the logos that are returned by the search query. - * Must be in range 1..256. If the value is out of range, the - * default value defined by the gpodder.net API will be used. - */ - public List searchPodcasts(String query, int scaledLogoSize) throws GpodnetServiceException { - String parameters = (scaledLogoSize > 0 && scaledLogoSize <= 256) ? String - .format(Locale.US, "q=%s&scale_logo=%d", query, scaledLogoSize) : String - .format("q=%s", query); - try { - URL url = new URI(baseScheme, null, baseHost, basePort, "/search.json", - parameters, 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 e) { - e.printStackTrace(); - throw new GpodnetServiceException(e); - } catch (URISyntaxException e) { - e.printStackTrace(); - throw new IllegalStateException(e); - } - } - /** * Returns all devices of a given user. *

diff --git a/ui/i18n/src/main/res/values/strings.xml b/ui/i18n/src/main/res/values/strings.xml index 0740b2734..8b7f8b9ea 100644 --- a/ui/i18n/src/main/res/values/strings.xml +++ b/ui/i18n/src/main/res/values/strings.xml @@ -761,7 +761,6 @@ Search Apple Podcasts Search Podcast Index Search fyyd - Search gpodder.net Advanced Add podcast by RSS address www.example.com/feed