use of net.technicpack.platform.io.SearchResultsData in project LauncherV3 by TechnicPack.
the class SearchResultPackSource method getPublicPacks.
@Override
public // Get PlatformPackInfo objects for every result from the given search terms.
Collection<PackInfo> getPublicPacks() {
resultPriorities.clear();
// Get results from server
SearchResultsData results = null;
try {
results = platformApi.getSearchResults(searchTerms);
} catch (RestfulAPIException ex) {
return Collections.emptySet();
}
ArrayList<PackInfo> resultPacks = new ArrayList<PackInfo>(results.getResults().length);
int priority = 100;
for (SearchResult result : results.getResults()) {
resultPacks.add(new SearchResultPackInfo(result));
resultPriorities.put(result.getSlug(), priority--);
}
return resultPacks;
}
Aggregations