summaryrefslogtreecommitdiffstats
path: root/apps/files/lib
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2013-11-28 03:46:42 -0800
committerFrank Karlitschek <frank@owncloud.org>2013-11-28 03:46:42 -0800
commitdab3629ff5c65de91813cde6e9adda769ece2609 (patch)
tree45d825c0bcd44ffd306b9d662b758ad7720449fd /apps/files/lib
parent30b2ed588b76544142fade70f9b849043d54e05a (diff)
parentbc64931cd06a6839e3ecde58e1f671abd44e08db (diff)
downloadnextcloud-server-dab3629ff5c65de91813cde6e9adda769ece2609.tar.gz
nextcloud-server-dab3629ff5c65de91813cde6e9adda769ece2609.zip
Merge pull request #6089 from owncloud/files-mimetyperefreshafterrename
Redetect mime type whenever extension is renamed
Diffstat (limited to 'apps/files/lib')
-rw-r--r--apps/files/lib/app.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/apps/files/lib/app.php b/apps/files/lib/app.php
index f5ac11b2168..ea94ea43ef3 100644
--- a/apps/files/lib/app.php
+++ b/apps/files/lib/app.php
@@ -76,12 +76,19 @@ class App {
$this->view->rename($dir . '/' . $oldname, $dir . '/' . $newname)
) {
// successful rename
- $result['success'] = true;
- $result['data'] = array(
- 'dir' => $dir,
- 'file' => $oldname,
- 'newname' => $newname
+ $meta = $this->view->getFileInfo($dir . '/' . $newname);
+ $fileinfo = array(
+ 'id' => $meta['fileid'],
+ 'mime' => $meta['mimetype'],
+ 'size' => $meta['size'],
+ 'etag' => $meta['etag'],
+ 'directory' => $dir,
+ 'name' => $newname,
+ 'isPreviewAvailable' => \OC::$server->getPreviewManager()->isMimeSupported($meta['mimetype']),
+ 'icon' => \OCA\Files\Helper::determineIcon($meta)
);
+ $result['success'] = true;
+ $result['data'] = $fileinfo;
} else {
// rename failed
$result['data'] = array(