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

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.
@@ -122,6 +122,7 @@ module.exports = function(RED) {
122
122
  const referenceTime = new Date();
123
123
  const timestamp = Math.floor(referenceTime.getTime() / 1000);
124
124
 
125
+ // Ripristinato toHikDate identico a prima (con la Z / UTC che andava)
125
126
  const startTime = toHikDate(new Date(referenceTime.getTime() - (20 * 1000)));
126
127
  const endTime = toHikDate(new Date(referenceTime.getTime() + (20 * 1000)));
127
128
  node.warn(`[STEP 2] Finestra temporale impostata: ${startTime} -> ${endTime}`);
@@ -160,8 +161,8 @@ module.exports = function(RED) {
160
161
  const trackFoto = (parsedChannel * 100) + 3;
161
162
 
162
163
  const tracks = [
163
- { id: trackVideo.toString(), isFoto: false, label: "VIDEO", type: "video" },
164
- { id: trackFoto.toString(), isFoto: true, label: "FOTO", type: "metadata" }
164
+ { id: trackVideo.toString(), isFoto: false, label: "VIDEO" },
165
+ { id: trackFoto.toString(), isFoto: true, label: "FOTO" }
165
166
  ];
166
167
  let fileDaCancellare = [];
167
168
 
@@ -169,8 +170,9 @@ module.exports = function(RED) {
169
170
  for (let t of tracks) {
170
171
  node.warn(`[STEP 4] Elaborazione traccia ${t.label} (ID: ${t.id})`);
171
172
 
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>`;
173
+ // RIPRISTINATO: XML identico riga per riga a quello vecchio della telecamera,
174
+ // ma usando la stringa di metadato corretta dell'NVR (recordType.meta.hikvision.com)
175
+ 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><maxResults>100</maxResults><metadataList><metadataDescriptor>recordType.meta.hikvision.com/${eventoNVR}</metadataDescriptor></metadataList></CMSearchDescription>`;
174
176
 
175
177
  node.warn(`[STEP 4.1] Invio POST /search per traccia ${t.id}. XML inviato:\n${searchXml}`);
176
178
 
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.54",
4
4
  "description": "Ottiene buffer video e immagine da camere Hikvision via ISAPI",
5
5
  "keywords": [
6
6
  "node-red",