From 80f522519192f840d14c5390c663a376b644f559 Mon Sep 17 00:00:00 2001 From: Moe Date: Fri, 3 Dec 2021 10:20:56 -0800 Subject: [PATCH] remove frame limit on timelapse frame retrieval --- libs/database/utils.js | 3 ++- libs/timelapse.js | 1 + web/assets/js/bs5.timelapseViewer.js | 6 +++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libs/database/utils.js b/libs/database/utils.js index f54428f0..cf3d61f1 100644 --- a/libs/database/utils.js +++ b/libs/database/utils.js @@ -177,6 +177,7 @@ module.exports = function(s,config){ ] const monitorRestrictions = options.monitorRestrictions var frameLimit = options.limit + const noLimit = options.noLimit === '1' const endIsStartTo = options.endIsStartTo const chosenDate = options.date const startDate = options.startDate ? stringToSqlTime(options.startDate) : null @@ -226,7 +227,7 @@ module.exports = function(s,config){ where: whereQuery, orderBy: options.orderBy, groupBy: options.groupBy, - limit: frameLimit || '500' + limit: noLimit ? undefined : frameLimit || '500' },(err,r) => { if(err){ callback({ diff --git a/libs/timelapse.js b/libs/timelapse.js index 4cdd42e0..e952fde1 100644 --- a/libs/timelapse.js +++ b/libs/timelapse.js @@ -203,6 +203,7 @@ module.exports = function(s,config,lang,app,io){ startOperator: req.query.startOperator, endOperator: req.query.endOperator, limit: req.query.limit, + noLimit: req.query.noLimit, archived: req.query.archived, rowType: 'frames', endIsStartTo: true diff --git a/web/assets/js/bs5.timelapseViewer.js b/web/assets/js/bs5.timelapseViewer.js index 596562a8..76c3f825 100644 --- a/web/assets/js/bs5.timelapseViewer.js +++ b/web/assets/js/bs5.timelapseViewer.js @@ -70,7 +70,11 @@ $(document).ready(function(e){ if(!startDate)startDate = dateRange.startDate if(!endDate)endDate = dateRange.endDate if(!selectedMonitor)selectedMonitor = monitorsList.val() - var queryString = ['start=' + startDate,'end=' + endDate] + var queryString = [ + 'start=' + startDate, + 'end=' + endDate, + 'noLimit=1' + ] var frameIconsHtml = '' var apiURL = apiBaseUrl + '/timelapse/' + $user.ke + '/' + selectedMonitor $.getJSON(apiURL + '?' + queryString.join('&'),function(data){