node-red-contrib-hik-media-buffer 1.1.98 → 1.1.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hik-media-buffer.js +11 -3
- package/package.json +1 -1
package/hik-media-buffer.js
CHANGED
|
@@ -118,9 +118,17 @@ module.exports = function(RED) {
|
|
|
118
118
|
const referenceTime = new Date();
|
|
119
119
|
const timestamp = Math.floor(referenceTime.getTime() / 1000);
|
|
120
120
|
|
|
121
|
-
//
|
|
122
|
-
const
|
|
123
|
-
|
|
121
|
+
// Forziamo l'azzeramento totale dei secondi (:00 e :59) come vuole il database Hikvision
|
|
122
|
+
const dStart = new Date(referenceTime.getTime() - (5 * 60 * 1000)); // 5 minuti fa
|
|
123
|
+
dStart.setSeconds(0, 0); // Forza :00 secondi e 0 millisecondi
|
|
124
|
+
|
|
125
|
+
const dEnd = new Date(referenceTime.getTime() + (2 * 60 * 1000)); // 2 minuti nel futuro
|
|
126
|
+
dEnd.setSeconds(59, 999); // Forza :59 secondi
|
|
127
|
+
|
|
128
|
+
const startTime = toJsonDate(dStart);
|
|
129
|
+
const endTime = toJsonDate(dEnd);
|
|
130
|
+
|
|
131
|
+
node.warn(`[DEBUG TEMPO SANIFICATO] Cerco da: ${startTime} a: ${endTime}`);
|
|
124
132
|
|
|
125
133
|
node.status({fill:"yellow", shape:"dot", text:`Ricerca Evento Cam ${channelID}...`});
|
|
126
134
|
|