node-red-contrib-hik-media-buffer 1.1.52 → 1.1.53

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.
@@ -160,8 +160,8 @@ module.exports = function(RED) {
160
160
  const trackFoto = (parsedChannel * 100) + 3;
161
161
 
162
162
  const tracks = [
163
- { id: trackVideo.toString(), isFoto: false, label: "VIDEO", type: "video" },
164
- { id: trackFoto.toString(), isFoto: true, label: "FOTO", type: "metadata" }
163
+ { id: trackVideo.toString(), isFoto: false, label: "VIDEO" },
164
+ { id: trackFoto.toString(), isFoto: true, label: "FOTO" }
165
165
  ];
166
166
  let fileDaCancellare = [];
167
167
 
@@ -169,8 +169,33 @@ module.exports = function(RED) {
169
169
  for (let t of tracks) {
170
170
  node.warn(`[STEP 4] Elaborazione traccia ${t.label} (ID: ${t.id})`);
171
171
 
172
- // COPIATO DALL'ISPEZIONA REALE AL 100%: Mantenuto l'ordine esatto dei tag per evitare l'errore "two root tags"
173
- const searchXml = `<?xml version="1.0" encoding="utf-8"?><CMSearchDescription><searchID>LAST_EVENT</searchID><trackIDList><trackID>${t.id}</trackID></trackIDList><timeSpanList><timeSpan><startTime>${startTime}</startTime><endTime>${endTime}</endTime></timeSpan></timeSpanList><contentTypeList><contentType>${t.type}</contentType></contentTypeList><maxResults>30</maxResults><searchResultPostion>0</searchResultPostion><metadataList><metadataDescriptor>recordType.meta.hikvision.com/${eventoNVR}</metadataDescriptor></metadataList></CMSearchDescription>`;
172
+ // COSTRUZIONE XML CON FORMATTAZIONE PULITA A LIVELLI (Risolve l'errore "two root tags")
173
+ let searchXml = `<?xml version="1.0" encoding="utf-8"?>\n` +
174
+ `<CMSearchDescription>\n` +
175
+ ` <searchID>LAST_EVENT</searchID>\n` +
176
+ ` <trackIDList>\n` +
177
+ ` <trackID>${t.id}</trackID>\n` +
178
+ ` </trackIDList>\n` +
179
+ ` <timeSpanList>\n` +
180
+ ` <timeSpan>\n` +
181
+ ` <startTime>${startTime}</startTime>\n` +
182
+ ` <endTime>${endTime}</endTime>\n` +
183
+ ` </timeSpan>\n` +
184
+ ` </timeSpanList>\n`;
185
+
186
+ // Inseriamo il contentTypeList SOLO per la foto, per la ricerca video standard dell'NVR va rimosso!
187
+ if (t.isFoto) {
188
+ searchXml += ` <contentTypeList>\n` +
189
+ ` <contentType>metadata</contentType>\n` +
190
+ ` </contentTypeList>\n`;
191
+ }
192
+
193
+ searchXml += ` <maxResults>30</maxResults>\n` +
194
+ ` <searchResultPostion>0</searchResultPostion>\n` +
195
+ ` <metadataList>\n` +
196
+ ` <metadataDescriptor>recordType.meta.hikvision.com/${eventoNVR}</metadataDescriptor>\n` +
197
+ ` </metadataList>\n` +
198
+ `</CMSearchDescription>`;
174
199
 
175
200
  node.warn(`[STEP 4.1] Invio POST /search per traccia ${t.id}. XML inviato:\n${searchXml}`);
176
201
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-hik-media-buffer",
3
- "version": "1.1.52",
3
+ "version": "1.1.53",
4
4
  "description": "Ottiene buffer video e immagine da camere Hikvision via ISAPI",
5
5
  "keywords": [
6
6
  "node-red",