iobroker.agent-dvr 0.2.0 → 0.2.2

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.
@@ -18,7 +18,7 @@
18
18
  };
19
19
  document.head.appendChild(script);
20
20
  </script>
21
- <script type="module" crossorigin src="./assets/index-ulvdM37k.js"></script>
21
+ <script type="module" crossorigin src="./assets/index-DFh6AKdK.js"></script>
22
22
  </head>
23
23
  <body>
24
24
  <noscript>You need to enable JavaScript to run this app.</noscript>
package/build/main.js CHANGED
@@ -386,20 +386,20 @@ class AgentDvr extends utils.Adapter {
386
386
  rows.push({ source: "go2rtc", name: s });
387
387
  }
388
388
  if (!rows.length) {
389
- rows.push({ source: "\u2014", name: "Keine Quellen gefunden (Adapter hat noch nicht gepollt)" });
389
+ rows.push({ source: "\u2014", name: "No sources found (adapter has not polled yet)" });
390
390
  }
391
391
  return { result: rows };
392
392
  }
393
393
  fetchGo2rtcStreams(overrideUrl) {
394
394
  const url = (overrideUrl || this.config.go2rtcUrl || "").replace(/^https:\/\//i, "http://");
395
395
  if (!url) {
396
- return Promise.resolve({ streams: [], error: "go2rtcUrl nicht konfiguriert" });
396
+ return Promise.resolve({ streams: [], error: "go2rtcUrl not configured" });
397
397
  }
398
398
  let target;
399
399
  try {
400
400
  target = new URL("/api/streams", url);
401
401
  } catch {
402
- return Promise.resolve({ streams: [], error: `Ung\xFCltige URL: ${url}` });
402
+ return Promise.resolve({ streams: [], error: `Invalid URL: ${url}` });
403
403
  }
404
404
  let httpReq;
405
405
  const fetch = new Promise((resolve) => {
@@ -415,20 +415,23 @@ class AgentDvr extends utils.Adapter {
415
415
  const streams = Object.keys(parsed || {});
416
416
  resolve({
417
417
  streams,
418
- error: streams.length === 0 ? "go2rtc antwortet, aber keine Streams konfiguriert" : void 0
418
+ error: streams.length === 0 ? "go2rtc reachable but no streams configured" : void 0
419
419
  });
420
420
  } catch {
421
- resolve({ streams: [], error: `Ung\xFCltige JSON-Antwort von go2rtc (HTTP ${res.statusCode})` });
421
+ resolve({
422
+ streams: [],
423
+ error: `Invalid JSON response from go2rtc (HTTP ${res.statusCode})`
424
+ });
422
425
  }
423
426
  });
424
- res.on("error", (e) => resolve({ streams: [], error: `Stream-Fehler: ${e.message}` }));
427
+ res.on("error", (e) => resolve({ streams: [], error: `Stream error: ${e.message}` }));
425
428
  });
426
- httpReq.on("error", (e) => resolve({ streams: [], error: `Verbindungsfehler: ${e.message}` }));
429
+ httpReq.on("error", (e) => resolve({ streams: [], error: `Connection error: ${e.message}` }));
427
430
  });
428
431
  const timeout = new Promise(
429
432
  (resolve) => this.setTimeout(() => {
430
433
  httpReq == null ? void 0 : httpReq.destroy();
431
- resolve({ streams: [], error: `Timeout beim Abrufen von ${target.toString()}` });
434
+ resolve({ streams: [], error: `Timeout fetching ${target.toString()}` });
432
435
  }, 3e3)
433
436
  );
434
437
  return Promise.race([fetch, timeout]);