torrent-online 1.4.10 → 1.4.11

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/wtui.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "torrent-online",
3
- "version": "1.4.10",
3
+ "version": "1.4.11",
4
4
  "type": "module",
5
5
  "description": "Stream .torrent / magnet to VLC or browser — torrent streaming for macOS/Linux without a torrent client. Стрим торрентов в VLC или браузер.",
6
6
  "keywords": [
package/wtui.js CHANGED
@@ -476,7 +476,7 @@ async function addTorrent(client, source, cacheDir) {
476
476
  client.add(source, { path: cacheDir }, t => {
477
477
  if (t.ready) { clearTimeout(to); return resolve(t); }
478
478
  const spin = setInterval(() => {
479
- process.stdout.write(`\r⏳ Метаданные: пиры ${t.peers.length}, получено ${fmtBytes(t.received)} `);
479
+ process.stdout.write(`\r⏳ Метаданные: пиры ${(t.peers?.length ?? 0)}, получено ${fmtBytes(t.received)} `);
480
480
  }, 1000);
481
481
  t.once('ready', () => { clearInterval(spin); process.stdout.write('\x1b[K'); clearTimeout(to); resolve(t); });
482
482
  });
@@ -487,7 +487,7 @@ async function addTorrent(client, source, cacheDir) {
487
487
  function startProgress(torrent) {
488
488
  const t = setInterval(() => {
489
489
  process.stdout.write(
490
- `\r⏬ ${(torrent.progress * 100).toFixed(1)}% · ${fmtBytes(torrent.downloadSpeed)}/s · пиры: ${torrent.peers.length} `
490
+ `\r⏬ ${(torrent.progress * 100).toFixed(1)}% · ${fmtBytes(torrent.downloadSpeed)}/s · пиры: ${(torrent._peers?.size ?? 0)} `
491
491
  );
492
492
  }, 1000);
493
493
  return () => { clearInterval(t); process.stdout.write('\x1b[K\n'); };