node-red-contrib-hik-media-buffer 1.1.93 → 1.1.95
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 +8 -8
- package/package.json +1 -1
package/hik-media-buffer.js
CHANGED
|
@@ -118,9 +118,9 @@ module.exports = function(RED) {
|
|
|
118
118
|
const referenceTime = new Date();
|
|
119
119
|
const timestamp = Math.floor(referenceTime.getTime() / 1000);
|
|
120
120
|
|
|
121
|
-
//
|
|
122
|
-
const startTime = toJsonDate(new Date(referenceTime.getTime() - (
|
|
123
|
-
const endTime = toJsonDate(new Date(referenceTime.getTime() + (
|
|
121
|
+
// Nuova finestra temporale larga: cerca da 10 minuti fa a 2 minuti nel futuro per compensare i disallineamenti di orario
|
|
122
|
+
const startTime = toJsonDate(new Date(referenceTime.getTime() - (10 * 60 * 1000)));
|
|
123
|
+
const endTime = toJsonDate(new Date(referenceTime.getTime() + (2 * 60 * 1000)));
|
|
124
124
|
|
|
125
125
|
node.status({fill:"yellow", shape:"dot", text:`Ricerca Evento Cam ${channelID}...`});
|
|
126
126
|
|
|
@@ -136,17 +136,17 @@ module.exports = function(RED) {
|
|
|
136
136
|
let fileDaCancellare = [];
|
|
137
137
|
|
|
138
138
|
try {
|
|
139
|
-
//
|
|
139
|
+
// Proviamo a passare il canale sia come stringa che come ID esteso per vedere quale digerisce il database
|
|
140
140
|
const searchPayload = {
|
|
141
141
|
"EventSearchDescription": {
|
|
142
|
-
"searchID":
|
|
142
|
+
"searchID": dynamicSearchId,
|
|
143
143
|
"searchResultPosition": 0,
|
|
144
144
|
"maxResults": 10,
|
|
145
145
|
"timeSpanList": [{ "startTime": startTime, "endTime": endTime }],
|
|
146
146
|
"type": "all",
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
"
|
|
147
|
+
// Se [parseInt(channelID)] dava vuoto, proviamo a passargli l'ID traccia video reale (es. 201)
|
|
148
|
+
// oppure la stringa del canale. Proviamo qui con la traccia video che è quella che contiene i dati:
|
|
149
|
+
"channels": [ parseInt(channelID * 100 + 1) ]
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
152
|
|