l10n->t('Podcast'); } public function getOrder(string $route, array $routeParameters): int { if (0 === strpos($route, Application::APP_ID.'.')) { // Active app, prefer my results return -1; } return 25; } public function search(IUser $user, ISearchQuery $query): SearchResult { $podcasts = $this->multiPodService->search($query->getTerm()); $searchResults = []; foreach ($podcasts as $podcast) { $title = $podcast->getTitle(); $link = $podcast->getLink(); if (isset($title, $link)) { $searchResults[] = new SearchResultEntry( $podcast->getImageUrl() ?? $this->urlGenerator->linkTo(Application::APP_ID, 'img/app.svg'), $title, $podcast->getAuthor() ?? '', $this->urlGenerator->linkToRoute('repod.page.index').'/#/'.urlencode(base64_encode($link)), $this->urlGenerator->linkTo(Application::APP_ID, 'img/app.svg') ); } } return SearchResult::complete( $this->l10n->t('Podcast'), $searchResults ); } }