Skip to content
Snippets Groups Projects
Commit 89916511 authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #19742 from owncloud/shareinfo_performance

Do not calculate non essential info
parents 1a84c8e9 5e9ca797
No related branches found
No related tags found
No related merge requests found
...@@ -137,10 +137,8 @@ class Helper { ...@@ -137,10 +137,8 @@ class Helper {
$entry['id'] = $i['fileid']; $entry['id'] = $i['fileid'];
$entry['parentId'] = $i['parent']; $entry['parentId'] = $i['parent'];
$entry['date'] = \OCP\Util::formatDate($i['mtime']);
$entry['mtime'] = $i['mtime'] * 1000; $entry['mtime'] = $i['mtime'] * 1000;
// only pick out the needed attributes // only pick out the needed attributes
$entry['icon'] = \OCA\Files\Helper::determineIcon($i);
if (\OC::$server->getPreviewManager()->isAvailable($i)) { if (\OC::$server->getPreviewManager()->isAvailable($i)) {
$entry['isPreviewAvailable'] = true; $entry['isPreviewAvailable'] = true;
} }
......
...@@ -117,9 +117,6 @@ class Test_OC_Files_App_Rename extends \Test\TestCase { ...@@ -117,9 +117,6 @@ class Test_OC_Files_App_Rename extends \Test\TestCase {
$this->assertEquals('abcdef', $result['data']['etag']); $this->assertEquals('abcdef', $result['data']['etag']);
$this->assertFalse(isset($result['data']['tags'])); $this->assertFalse(isset($result['data']['tags']));
$this->assertEquals('/', $result['data']['path']); $this->assertEquals('/', $result['data']['path']);
$icon = \OC_Helper::mimetypeIcon('dir-external');
$icon = substr($icon, 0, -3) . 'svg';
$this->assertEquals($icon, $result['data']['icon']);
} }
/** /**
...@@ -182,9 +179,6 @@ class Test_OC_Files_App_Rename extends \Test\TestCase { ...@@ -182,9 +179,6 @@ class Test_OC_Files_App_Rename extends \Test\TestCase {
$this->assertEquals('abcdef', $result['data']['etag']); $this->assertEquals('abcdef', $result['data']['etag']);
$this->assertEquals(array('tag1', 'tag2'), $result['data']['tags']); $this->assertEquals(array('tag1', 'tag2'), $result['data']['tags']);
$this->assertEquals('/', $result['data']['path']); $this->assertEquals('/', $result['data']['path']);
$icon = \OC_Helper::mimetypeIcon('text');
$icon = substr($icon, 0, -3) . 'svg';
$this->assertEquals($icon, $result['data']['icon']);
\OC::$server->registerService('TagManager', function ($c) use ($oldTagManager) { \OC::$server->registerService('TagManager', function ($c) use ($oldTagManager) {
return $oldTagManager; return $oldTagManager;
......
...@@ -110,9 +110,7 @@ class ApiControllerTest extends TestCase { ...@@ -110,9 +110,7 @@ class ApiControllerTest extends TestCase {
[ [
'id' => null, 'id' => null,
'parentId' => null, 'parentId' => null,
'date' => \OCP\Util::formatDate(55),
'mtime' => 55000, 'mtime' => 55000,
'icon' => \OCA\Files\Helper::determineIcon($fileInfo),
'name' => 'root.txt', 'name' => 'root.txt',
'permissions' => null, 'permissions' => null,
'mimetype' => 'application/pdf', 'mimetype' => 'application/pdf',
...@@ -175,9 +173,7 @@ class ApiControllerTest extends TestCase { ...@@ -175,9 +173,7 @@ class ApiControllerTest extends TestCase {
[ [
'id' => null, 'id' => null,
'parentId' => null, 'parentId' => null,
'date' => \OCP\Util::formatDate(55),
'mtime' => 55000, 'mtime' => 55000,
'icon' => \OCA\Files\Helper::determineIcon($fileInfo1),
'name' => 'root.txt', 'name' => 'root.txt',
'permissions' => null, 'permissions' => null,
'mimetype' => 'application/pdf', 'mimetype' => 'application/pdf',
...@@ -194,9 +190,7 @@ class ApiControllerTest extends TestCase { ...@@ -194,9 +190,7 @@ class ApiControllerTest extends TestCase {
[ [
'id' => null, 'id' => null,
'parentId' => null, 'parentId' => null,
'date' => \OCP\Util::formatDate(999),
'mtime' => 999000, 'mtime' => 999000,
'icon' => \OCA\Files\Helper::determineIcon($fileInfo2),
'name' => 'root.txt', 'name' => 'root.txt',
'permissions' => null, 'permissions' => null,
'mimetype' => 'application/binary', 'mimetype' => 'application/binary',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment