Don't join facerect for days (#105)

old-stable24
Varun Patil 2022-10-24 09:21:38 -07:00
parent 36778605b3
commit f2367ac7b7
2 changed files with 7 additions and 8 deletions

View File

@ -102,7 +102,7 @@ class ApiController extends Controller
$uid, $uid,
$recursive, $recursive,
$archive, $archive,
$this->getTransformations(), $this->getTransformations(true),
); );
// Preload some day responses // Preload some day responses
@ -175,7 +175,7 @@ class ApiController extends Controller
$day_ids, $day_ids,
$recursive, $recursive,
$archive, $archive,
$this->getTransformations(), $this->getTransformations(false),
); );
return new JSONResponse($list, Http::STATUS_OK); return new JSONResponse($list, Http::STATUS_OK);
@ -637,8 +637,10 @@ class ApiController extends Controller
/** /**
* Get transformations depending on the request. * 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 = []; $transforms = [];
@ -660,7 +662,7 @@ class ApiController extends Controller
} }
$faceRect = $this->request->getParam('facerect'); $faceRect = $this->request->getParam('facerect');
if ($faceRect) { if ($faceRect && !$aggregateOnly) {
$transforms[] = [$this->timelineQuery, 'transformFaceRect', $face]; $transforms[] = [$this->timelineQuery, 'transformFaceRect', $face];
} }
} }
@ -686,7 +688,7 @@ class ApiController extends Controller
private function preloadDays(array &$days, Folder &$folder, bool $recursive, bool $archive) private function preloadDays(array &$days, Folder &$folder, bool $recursive, bool $archive)
{ {
$uid = $this->userSession->getUser()->getUID(); $uid = $this->userSession->getUser()->getUID();
$transforms = $this->getTransformations(); $transforms = $this->getTransformations(false);
$preloaded = 0; $preloaded = 0;
foreach ($days as &$day) { foreach ($days as &$day) {
$day['detail'] = $this->timelineQuery->getDay( $day['detail'] = $this->timelineQuery->getDay(

View File

@ -122,9 +122,6 @@ trait TimelineQueryDays
foreach ($days as &$row) { foreach ($days as &$row) {
$row['dayid'] = (int) $row['dayid']; $row['dayid'] = (int) $row['dayid'];
$row['count'] = (int) $row['count']; $row['count'] = (int) $row['count'];
// All transform processing
$this->processFace($row, true);
} }
return $days; return $days;