Skip to content

Commit

Permalink
Include addtional information to nonlocalized photos
Browse files Browse the repository at this point in the history
Signed-off-by: Arne Hamann <[email protected]>
  • Loading branch information
tacruc committed Mar 23, 2022
1 parent 6b6ac89 commit aeafd50
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions lib/Service/GeophotoService.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,11 @@ public function getNonLocalizedFromDB ($userId) {
continue;
}
$file = array_shift($files);
if ($file === null) {
continue;
}
$path = preg_replace('/^\/'.$userId.'\//', '', $file->getPath());
if ($file === null) {
continue;
}
$path = $userFolder->getRelativePath( $file->getPath());
$isRoot = $file === $userFolder;

$date = $photoEntity->getDateTaken() ?? \time();
$locations = $this->getLocationGuesses($date);
Expand All @@ -146,6 +147,17 @@ public function getNonLocalizedFromDB ($userId) {
$file_object->lat = $location[0];
$file_object->lng = $location[1];
$file_object->dateTaken = $date;
$file_object->basename = $isRoot ? '' : $file->getName();
$file_object->filename = $this->normalizePath($path);
$file_object->etag = $cacheEntry->getEtag();
//Not working for NC21 as Viewer requires String representation of permissions
// $file_object->permissions = $file->getPermissions();
$file_object->type = $file->getType();
$file_object->mime = $file->getMimetype();
$file_object->lastmod = $file->getMTime();
$file_object->size = $file->getSize();
$file_object->path = $path;
$file_object->hasPreview = in_array($cacheEntry->getMimeType(), $previewEnableMimetypes);
$filesById[] = $file_object;
}

Expand Down

0 comments on commit aeafd50

Please sign in to comment.