From aac82bff63c048b10af21257a80f7b109dfcea9d Mon Sep 17 00:00:00 2001 From: Moe Date: Mon, 27 Jun 2022 00:41:57 -0700 Subject: [PATCH] Fix Timelapse Video download when File Already Exists --- libs/timelapse.js | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/libs/timelapse.js b/libs/timelapse.js index fdb19476..99e2a842 100644 --- a/libs/timelapse.js +++ b/libs/timelapse.js @@ -329,7 +329,6 @@ module.exports = function(s,config,lang,app,io){ ke: ke, mid: mid, name: finalFileName, - fileLocation: finalMp4OutputLocation, } s.debugLog("activeMonitor.buildingTimelapseVideo",!!activeMonitor.buildingTimelapseVideo) if(activeMonitor.buildingTimelapseVideo){ @@ -353,20 +352,7 @@ module.exports = function(s,config,lang,app,io){ listFile: concatListFile, fps: framesPerSecond, output: finalMp4OutputLocation, - finalFileName: finalFileName, - onPercentChange: (percent,currentFrame) => { - s.tx({ - f: 'timelapse_build_percent', - ke: ke, - mid: mid, - name: finalFileName, - percent: percent, - },'GRP_'+ke); - if(percent == 100){ - s.debugLog('videoBuildProcess 100%',finalMp4OutputLocation) - } - s.debugLog('Completion',`${currentFrame} / ${numberOfFrames}`,`${percent}%`) - }, + finalFileName: finalFileName }).then(async () => { // videoBuildProcess exit s.debugLog('videoBuildProcess exit',finalMp4OutputLocation) @@ -502,12 +488,7 @@ module.exports = function(s,config,lang,app,io){ return } const buildResponse = await createVideoFromTimelapse(r.reverse(),s.getPostData(req, 'fps')) - s.closeJsonResponse(res,{ - ok : buildResponse.ok, - filename : buildResponse.filename, - fileExists : !!buildResponse.fileExists, - msg : buildResponse.msg, - }) + s.closeJsonResponse(res,buildResponse) }) },res,req); });