@torrent-tv/proxy 2.96.12 → 2.96.14

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@torrent-tv/proxy",
3
- "version": "2.96.12",
3
+ "version": "2.96.14",
4
4
  "description": "Torrent proxy client that exposes webseed-like HTTP stream endpoint.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "repository": {
package/server.js CHANGED
@@ -423,7 +423,14 @@ export async function startProxyServer({
423
423
  /** Source byte ranges of one segment interval, by file and interval; forgotten with the source. */
424
424
  const segmentSourceRanges = new Map();
425
425
  const downloadMaps = new DownloadMaps({
426
- publish: (map) => torrentPool.setPriorityMap(map),
426
+ // The ranges a picture reads at open are named again by every segment;
427
+ // only the zone the swarm would rank first is sent (torrent-tv/meta#166).
428
+ // Left out of what is SENT and nowhere else: every segment's own zones are
429
+ // also what says which bytes that segment needs, and a segment whose zones
430
+ // all repeat another's — two of one group of pictures in an AVI read the
431
+ // same bytes — lost them with 2.96.11, and the start forecast answered
432
+ // "source-input-ranges-unavailable" for ever (Home Assistant 2026-10-11).
433
+ publish: (map) => torrentPool.setPriorityMap({ ...map, zones: withoutRepeatedZones(map.zones) }),
427
434
  log: (line) => logger.info(line),
428
435
  resolvePlayback: async (map) => {
429
436
  if (map.zones.length === 0) return [];
@@ -534,9 +541,7 @@ export async function startProxyServer({
534
541
  segmentSourceRanges.set(rangesKey, input.ranges);
535
542
  convert(input.ranges);
536
543
  }
537
- // The ranges a picture reads at open are named again by every segment;
538
- // only the zone the swarm would rank first is sent (torrent-tv/meta#166).
539
- return withoutRepeatedZones(converted);
544
+ return converted;
540
545
  }
541
546
  });
542
547
  const mediaReads = new MediaReadRequests({
@@ -812,7 +812,7 @@ export class EncodeRun {
812
812
  // is moved either way — but nothing was resumed, and saying so is what
813
813
  // stops a dead run being reported as producing again.
814
814
  const continued = this.#signal("SIGCONT");
815
- this.#transition(ENCODE_RUN_EVENT.RESUMED);
815
+ this.#transition(ENCODE_RUN_EVENT.RESUME_ORDERED);
816
816
  this.clock.continued();
817
817
  return continued;
818
818
  }
@@ -1066,6 +1066,13 @@ export class EncodeRuns {
1066
1066
  // cannot reach it.
1067
1067
  run.inputThrough = inputEnd;
1068
1068
  run.process.stdin.end();
1069
+ // THE NEXT STRETCH IS PREPARED WHILE THIS ONE IS BEING MADE. Asked for
1070
+ // only when this run had ended, its copy fell between the two runs and
1071
+ // nothing made the picture meanwhile: field 2026-10-11, 909 MB copied in
1072
+ // 48.9 s after run #1..#32 ended, then the start of #33..#892, and the
1073
+ // viewer stood 69 s (torrent-tv/meta#166). Asked now, it is copied while
1074
+ // this run works and is ready when the plan places the next run there.
1075
+ if (inputEnd < mayReach) this.#host.encodeInputs?.take(session, inputEnd + 1, mayReach);
1069
1076
  } else if (admittedInput) {
1070
1077
  run.inputFingerprint = admittedInput.fingerprint;
1071
1078
  run.admittedInputKeys = new Map([[safeIndex, inputKey]]);