Skip to content

Commit

Permalink
Fixed issue nextcloud#35
Browse files Browse the repository at this point in the history
Signed-off-by: Arne Hamann <kontakt+github@arne.email>
  • Loading branch information
tacruc committed Apr 4, 2019
1 parent 76e7395 commit d7e277d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/Controller/ContactsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct($AppName, ILogger $logger, IRequest $request, IManag
* @NoCSRFRequired
*/
public function getContacts() {
$result = $this->contactsManager->search(',',['GEO']);
$result = $this->contactsManager->search('geo:',['GEO'],['types'=>false]);
return new DataResponse($result);
}

Expand Down
26 changes: 14 additions & 12 deletions lib/Service/GeophotoService.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,20 @@ public function getAllFromDB ($userId) {
$previewEnableMimetypes = $this->getPreviewEnabledMimetypes();
foreach ($photoEntities as $photoEntity) {
$cacheEntry = $cache->get($photoEntity->getFileId());
$path = $cacheEntry->getPath();
$file_object = new \stdClass();
$file_object->fileId = $photoEntity->getFileId();
$file_object->lat = $photoEntity->getLat();
$file_object->lng = $photoEntity->getLng();
$file_object->dateTaken = $photoEntity->getDateTaken();
/* 30% longer
* $file_object->folderId = $cache->getParentId($path);
*/
$file_object->path = $this->normalizePath($path);
$file_object->hasPreview = in_array($cacheEntry->getMimeType(), $previewEnableMimetypes);
$filesById[] = $file_object;
if ($cacheEntry) {
$path = $cacheEntry->getPath();
$file_object = new \stdClass();
$file_object->fileId = $photoEntity->getFileId();
$file_object->lat = $photoEntity->getLat();
$file_object->lng = $photoEntity->getLng();
$file_object->dateTaken = $photoEntity->getDateTaken();
/* 30% longer
* $file_object->folderId = $cache->getParentId($path);
*/
$file_object->path = $this->normalizePath($path);
$file_object->hasPreview = in_array($cacheEntry->getMimeType(), $previewEnableMimetypes);
$filesById[] = $file_object;
}
}
return $filesById;
}
Expand Down

0 comments on commit d7e277d

Please sign in to comment.