Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(search): add IExternalProvider flag
Signed-off-by: Andrey Borysenko <[email protected]>
  • Loading branch information
andrey18106 committed Aug 26, 2025
commit 5cdf15ef675b0468111ad0359c64a4194ceec4cc
7 changes: 6 additions & 1 deletion lib/Search/NotionSearchDatabasesProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\IUser;
use OCP\Search\IExternalProvider;
use OCP\Search\IProvider;

use OCP\Search\ISearchQuery;
use OCP\Search\SearchResult;
use OCP\Security\ICrypto;

class NotionSearchDatabasesProvider implements IProvider {
class NotionSearchDatabasesProvider implements IProvider, IExternalProvider {

public function __construct(
private IAppManager $appManager,
Expand Down Expand Up @@ -156,4 +157,8 @@ protected function getThumbnailUrl(array $entry): string {
}
return '';
}

public function isExternalProvider(): bool {
return true;
}
}
11 changes: 8 additions & 3 deletions lib/Search/NotionSearchPagesProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\IUser;
use OCP\Search\IExternalProvider;
use OCP\Search\IProvider;

use OCP\Search\ISearchQuery;
use OCP\Search\SearchResult;
use OCP\Security\ICrypto;

class NotionSearchPagesProvider implements IProvider {
class NotionSearchPagesProvider implements IProvider, IExternalProvider {

public function __construct(
private IAppManager $appManager,
Expand Down Expand Up @@ -161,10 +162,14 @@ protected function getLinkToNotion(array $entry): string {
* @return string
*/
protected function getThumbnailUrl(array $entry): string {
if (isset($entry['icon']['type']) && $entry['icon']['type'] === 'file'
|| isset($entry['icon']['type']) && $entry['icon']['type'] === 'external') {
if ((isset($entry['icon']['type']) && $entry['icon']['type'] === 'file')
|| (isset($entry['icon']['type']) && $entry['icon']['type'] === 'external')) {
return $this->urlGenerator->linkToRoute('integration_notion.notionAPI.getThumbnail', ['notionObjectId' => $entry['id'], 'objectType' => 'page']);
}
return '';
}

public function isExternalProvider(): bool {
return true;
}
}