From f0449b3a1d293ef5020ecbe9a41326f46cd8f047 Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Sat, 30 May 2015 00:29:21 +0300 Subject: [PATCH] Add etag to the response --- js/search.js | 1 + search/luceneresult.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/js/search.js b/js/search.js index 725268b01..bb4298ca1 100644 --- a/js/search.js +++ b/js/search.js @@ -20,6 +20,7 @@ OCA.Files.App.fileList.lazyLoadPreview({ path: result.path, mime: result.mime, + etag: result.etag, callback: function (url) { $row.find('td.icon').css('background-image', 'url(' + url + ')'); } diff --git a/search/luceneresult.php b/search/luceneresult.php index b36638383..5719f38fb 100644 --- a/search/luceneresult.php +++ b/search/luceneresult.php @@ -49,6 +49,9 @@ public function __construct(QueryHit $hit) { $this->permissions = $this->getPermissions($this->path); $this->modified = (int)$hit->mtime; $this->mime_type = $hit->mimetype; + + $fileInfo = \OC\Files\Filesystem::getFileInfo($this->path); + $this->etag = $fileInfo->getEtag(); } protected function getRelativePath ($path) {