Search in sources :

Example 1 with CombinedSearcher

use of de.danoeh.antennapod.discovery.CombinedSearcher in project AntennaPod by AntennaPod.

the class OnlineFeedViewActivity method searchFeedUrlByTrackName.

private String searchFeedUrlByTrackName(String trackName, String artistName) {
    CombinedSearcher searcher = new CombinedSearcher();
    String query = trackName + " " + artistName;
    List<PodcastSearchResult> results = searcher.search(query).blockingGet();
    for (PodcastSearchResult result : results) {
        if (result.feedUrl != null && result.author != null && result.author.equalsIgnoreCase(artistName) && result.title.equalsIgnoreCase(trackName)) {
            return result.feedUrl;
        }
    }
    return null;
}
Also used : CombinedSearcher(de.danoeh.antennapod.discovery.CombinedSearcher) SpannableString(android.text.SpannableString) PodcastSearchResult(de.danoeh.antennapod.discovery.PodcastSearchResult)

Aggregations

SpannableString (android.text.SpannableString)1 CombinedSearcher (de.danoeh.antennapod.discovery.CombinedSearcher)1 PodcastSearchResult (de.danoeh.antennapod.discovery.PodcastSearchResult)1