]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix mimetype detection, introduce fake etag to identify preview images
authorBjoern Schiessle <schiessle@owncloud.com>
Mon, 3 Mar 2014 11:23:21 +0000 (12:23 +0100)
committerBjoern Schiessle <schiessle@owncloud.com>
Mon, 10 Mar 2014 14:13:28 +0000 (15:13 +0100)
apps/files_trashbin/lib/helper.php

index 4bb51860485174e475ee6d05cc57ec10a9014f8c..fe0d1d30a72d5ca2310fe03beba40825337a1e04 100644 (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') {