diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-11-27 21:34:19 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-11-27 21:35:00 +0100 |
commit | 68f610a90e496f95bec54dd97e992a01e34c61bc (patch) | |
tree | 86566ed62a403fecefc9901ed0ed0969be4ee33a /apps/files/lib | |
parent | 43b1cf798839888e9e7266d80f55f6ce6f74d852 (diff) | |
download | nextcloud-server-68f610a90e496f95bec54dd97e992a01e34c61bc.tar.gz nextcloud-server-68f610a90e496f95bec54dd97e992a01e34c61bc.zip |
Update file list entry on rename
Whenever a file is renamed, if the extension changes, the mime type and
preview might change. This fix passes the updated info to the client
that updates it.
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( |