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.
@@ -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
- // Finestra temporale di ricerca: 15 secondi prima e 15 secondi dopo l'evento
122
- const startTime = toJsonDate(new Date(referenceTime.getTime() - (15 * 1000)));
123
- const endTime = toJsonDate(new Date(referenceTime.getTime() + (15 * 1000)));
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
- // Generazione del Payload JSON per interrogare il registro eventi dell'NVR
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": "D57A6C81-7FCB-4015-8156-71A54B486925",
142
+ "searchID": dynamicSearchId,
143
143
  "searchResultPosition": 0,
144
144
  "maxResults": 10,
145
145
  "timeSpanList": [{ "startTime": startTime, "endTime": endTime }],
146
146
  "type": "all",
147
- "channels": [ parseInt(channelID) ],
148
- "eventType": "behavior",
149
- "behavior": { "behaviorEventType": evento.toLowerCase() }
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-hik-media-buffer",
3
- "version": "1.1.93",
3
+ "version": "1.1.95",
4
4
  "description": "Ottiene buffer video e immagine da camere Hikvision via ISAPI",
5
5
  "keywords": [
6
6
  "node-red",