Skip to content
Snippets Groups Projects
Commit c53c4b97 authored by Robin Appelman's avatar Robin Appelman
Browse files

fix search by mime for shared single files

parent 3fc809df
Branches
No related tags found
No related merge requests found
...@@ -86,14 +86,13 @@ class Shared_Cache extends Cache { ...@@ -86,14 +86,13 @@ class Shared_Cache extends Cache {
public function get($file) { public function get($file) {
if (is_string($file)) { if (is_string($file)) {
if ($cache = $this->getSourceCache($file)) { if ($cache = $this->getSourceCache($file)) {
$path = 'files' . $this->storage->getMountPoint();
$path .= ($file !== '') ? '/' . $file : '';
$data = $cache->get($this->files[$file]); $data = $cache->get($this->files[$file]);
$data['displayname_owner'] = \OC_User::getDisplayName($this->storage->getSharedFrom()); $data['displayname_owner'] = \OC_User::getDisplayName($this->storage->getSharedFrom());
$data['path'] = $path; $data['path'] = '';
if ($file === '') { if ($file === '') {
$data['is_share_mount_point'] = true; $data['is_share_mount_point'] = true;
} }
$data['uid_owner'] = $this->storage->getOwner($file);
return $data; return $data;
} }
} else { } else {
...@@ -299,6 +298,11 @@ class Shared_Cache extends Cache { ...@@ -299,6 +298,11 @@ class Shared_Cache extends Cache {
$files = $this->getFolderContents($dir); $files = $this->getFolderContents($dir);
// no results? // no results?
if (!$files) { if (!$files) {
// maybe it's a single shared file
$file = $this->get('');
if (($mimepart && $file['mimepart'] === $mimepart) || ($mimetype && $file['mimetype'] === $mimetype)) {
$result[] = $file;
}
continue; continue;
} }
foreach ($files as $file) { foreach ($files as $file) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment