diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-21 16:12:10 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-21 16:12:10 +0200 |
commit | 1d2f4aa540b6c0d805424c2a165eec8a0edd0898 (patch) | |
tree | 31248f4e5ec2d2aee5475192b518eabe229b5ba8 /apps | |
parent | fd6b4de2d4bcaebc291610bb1102daedab73644a (diff) | |
parent | a174ba5a36cff8fa2230a0c10c849ddcdb71ded4 (diff) | |
download | nextcloud-server-1d2f4aa540b6c0d805424c2a165eec8a0edd0898.tar.gz nextcloud-server-1d2f4aa540b6c0d805424c2a165eec8a0edd0898.zip |
Merge pull request #19215 from owncloud/fix_trashbin_previews
fix trashbin previews for text files
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_trashbin/lib/helper.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/helper.php b/apps/files_trashbin/lib/helper.php index f51185712a9..0baa2b5414b 100644 --- a/apps/files_trashbin/lib/helper.php +++ b/apps/files_trashbin/lib/helper.php @@ -65,11 +65,14 @@ class Helper if (!\OC\Files\Filesystem::isIgnoredDir($entryName)) { $id = $entryName; if ($dir === '' || $dir === '/') { + $size = $view->filesize($id); $pathparts = pathinfo($entryName); $timestamp = substr($pathparts['extension'], 1); $id = $pathparts['filename']; + } else if ($timestamp === null) { // for subfolders we need to calculate the timestamp only once + $size = $view->filesize($dir . '/' . $id); $parts = explode('/', ltrim($dir, '/')); $timestamp = substr(pathinfo($parts[0], PATHINFO_EXTENSION), 1); } @@ -86,6 +89,7 @@ class Helper 'mimetype' => $view->is_dir($dir . '/' . $entryName) ? 'httpd/unix-directory' : \OC_Helper::getFileNameMimeType($id), 'type' => $view->is_dir($dir . '/' . $entryName) ? 'dir' : 'file', 'directory' => ($dir === '/') ? '' : $dir, + 'size' => $size, ); if ($originalPath) { $i['extraData'] = $originalPath.'/'.$id; |