diff --git a/lib/Controller/ApiController.php b/lib/Controller/ApiController.php index 53d63434..0bdbd28d 100644 --- a/lib/Controller/ApiController.php +++ b/lib/Controller/ApiController.php @@ -102,7 +102,7 @@ class ApiController extends Controller $uid, $recursive, $archive, - $this->getTransformations(), + $this->getTransformations(true), ); // Preload some day responses @@ -175,7 +175,7 @@ class ApiController extends Controller $day_ids, $recursive, $archive, - $this->getTransformations(), + $this->getTransformations(false), ); return new JSONResponse($list, Http::STATUS_OK); @@ -637,8 +637,10 @@ class ApiController extends Controller /** * Get transformations depending on the request. + * + * @param bool $aggregateOnly Only apply transformations for aggregation (days call) */ - private function getTransformations() + private function getTransformations(bool $aggregateOnly) { $transforms = []; @@ -660,7 +662,7 @@ class ApiController extends Controller } $faceRect = $this->request->getParam('facerect'); - if ($faceRect) { + if ($faceRect && !$aggregateOnly) { $transforms[] = [$this->timelineQuery, 'transformFaceRect', $face]; } } @@ -686,7 +688,7 @@ class ApiController extends Controller private function preloadDays(array &$days, Folder &$folder, bool $recursive, bool $archive) { $uid = $this->userSession->getUser()->getUID(); - $transforms = $this->getTransformations(); + $transforms = $this->getTransformations(false); $preloaded = 0; foreach ($days as &$day) { $day['detail'] = $this->timelineQuery->getDay( diff --git a/lib/Db/TimelineQueryDays.php b/lib/Db/TimelineQueryDays.php index f1844a2e..9b5b8c0f 100644 --- a/lib/Db/TimelineQueryDays.php +++ b/lib/Db/TimelineQueryDays.php @@ -122,9 +122,6 @@ trait TimelineQueryDays foreach ($days as &$row) { $row['dayid'] = (int) $row['dayid']; $row['count'] = (int) $row['count']; - - // All transform processing - $this->processFace($row, true); } return $days;