From 70c824927742e359e015351e4e3d713ae2dba505 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sat, 15 Oct 2022 12:23:31 -0700 Subject: [PATCH] Add w/h to day response --- lib/Db/TimelineQueryDays.php | 4 +++- src/types.ts | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Db/TimelineQueryDays.php b/lib/Db/TimelineQueryDays.php index 2326524d..ac8c9dc5 100644 --- a/lib/Db/TimelineQueryDays.php +++ b/lib/Db/TimelineQueryDays.php @@ -35,6 +35,8 @@ trait TimelineQueryDays { $row["fileid"] = intval($row["fileid"]); $row["isvideo"] = intval($row["isvideo"]); $row["dayid"] = intval($row["dayid"]); + $row["w"] = intval($row["w"]); + $row["h"] = intval($row["h"]); if (!$row["isvideo"]) { unset($row["isvideo"]); } @@ -160,7 +162,7 @@ trait TimelineQueryDays { // We don't actually use m.datetaken here, but postgres // needs that all fields in ORDER BY are also in SELECT // when using DISTINCT on selected fields - $query->select($fileid, 'f.etag', 'm.isvideo', 'vco.categoryid', 'm.datetaken', 'm.dayid') + $query->select($fileid, 'f.etag', 'm.isvideo', 'vco.categoryid', 'm.datetaken', 'm.dayid', 'm.w', 'm.h') ->from('memories', 'm') ->innerJoin('m', 'filecache', 'f', $this->getFilecacheJoinQuery($query, $folder, $recursive, $archive)); diff --git a/src/types.ts b/src/types.ts index f9789771..2cd9054b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -39,6 +39,10 @@ export type IPhoto = { flag: number; /** DayID from server */ dayid?: number; + /** Width of full image */ + w?: number; + /** Height of full image */ + h?: number; /** Reference to day object */ d?: IDay; /** Video flag from server */