torrent-online 1.5.3 → 1.5.4

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 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "torrent-online",
3
- "version": "1.5.3",
3
+ "version": "1.5.4",
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
@@ -470,6 +470,7 @@ async function addTorrent(client, source, cacheDir) {
470
470
  META_TIMEOUT_MS
471
471
  );
472
472
  client.add(source, { path: cacheDir }, t => {
473
+ t.files.forEach(f => f.deselect()); // не качаем всё подряд до выбора пользователя
473
474
  if (t.ready) { clearTimeout(to); return resolve(t); }
474
475
  const spin = setInterval(() => {
475
476
  process.stdout.write(`\r⏳ Метаданные: пиры ${(t.peers?.length ?? 0)}, получено ${fmtBytes(t.received)} `);
@@ -740,6 +741,7 @@ async function startWeb(opts, srcArg) {
740
741
  if (id == null) return;
741
742
  const dup = [...st.torrents.values()].find(e => e.t.infoHash === t.infoHash);
742
743
  if (dup) { try { t.destroy(); } catch {} return; }
744
+ t.files.forEach(f => f.deselect()); // webtorrent по умолчанию выбирает все файлы
743
745
  const sel = new Set();
744
746
  const vids = t.files.map((f, i) => ({ f, i })).filter(x => VIDEO_EXT.has(path.extname(x.f.name).toLowerCase()));
745
747
  if (st.autoSelect) {