fix mimetype detection, introduce fake etag to identify preview images

This commit is contained in:
Bjoern Schiessle 2014-03-03 12:23:21 +01:00
parent 4562909a20
commit 5ddabd7cd0

View file

@ -41,7 +41,7 @@ class Helper
$result[] = array(
'id' => $id,
'timestamp' => $timestamp,
'mime' => $view->getMimeType($dir . '/' . $entryName),
'mime' => \OC_Helper::getFileNameMimeType($id),
'type' => $view->is_dir($dir . '/' . $entryName) ? 'dir' : 'file',
'location' => $dir,
);
@ -58,6 +58,7 @@ class Helper
$i['name'] = $r['id'];
$i['date'] = \OCP\Util::formatDate($r['timestamp']);
$i['timestamp'] = $r['timestamp'];
$i['etag'] = $r['timestamp']; // add fake etag, it is only needed to identify the preview image
$i['mimetype'] = $r['mime'];
$i['type'] = $r['type'];
if ($i['type'] === 'file') {