Add attributes to file search results
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
cc92d5a293
commit
885dabb761
|
@ -110,13 +110,16 @@ class FilesSearchProvider implements IProvider {
|
|||
? $this->urlGenerator->linkToRouteAbsolute('core.Preview.getPreviewByFileId', ['x' => 32, 'y' => 32, 'fileId' => $result->id])
|
||||
: '';
|
||||
|
||||
return new SearchResultEntry(
|
||||
$searchResultEntry = new SearchResultEntry(
|
||||
$thumbnailUrl,
|
||||
$result->name,
|
||||
$this->formatSubline($result),
|
||||
$this->urlGenerator->getAbsoluteURL($result->link),
|
||||
$result->type === 'folder' ? 'icon-folder' : $this->mimeTypeDetector->mimeTypeIcon($result->mime_type)
|
||||
);
|
||||
$searchResultEntry->addAttribute('fileId', (string)$result->id);
|
||||
$searchResultEntry->addAttribute('path', $result->path);
|
||||
return $searchResultEntry;
|
||||
}, $this->fileSearch->search($query->getTerm()))
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue