diff options
author | Frank Karlitschek <frank@owncloud.org> | 2013-11-28 03:46:42 -0800 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2013-11-28 03:46:42 -0800 |
commit | dab3629ff5c65de91813cde6e9adda769ece2609 (patch) | |
tree | 45d825c0bcd44ffd306b9d662b758ad7720449fd /apps/files/lib | |
parent | 30b2ed588b76544142fade70f9b849043d54e05a (diff) | |
parent | bc64931cd06a6839e3ecde58e1f671abd44e08db (diff) | |
download | nextcloud-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.php | 17 |
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( |