@torrent-tv/proxy 2.9.121 → 2.9.122

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 2.9.122
2
+
3
+ - **Fix**: A session created with a start position begins encoding there, instead of at the top of the file. The position was honoured everywhere except the one place that mattered: it went into the session key and into the log line, and then the first run started at index 0 regardless. Measured 2026-08-06 on a Retry after the proxy had restarted — the session was created with `start=1580s`, the encoder began at #0, the player asked for #152, and 45 s later the browser gave up with "no data arrived from the proxy" while the transcode ran happily at 9.9x through the opening credits.
4
+
1
5
  ## 2.9.121
2
6
 
3
7
  - **Fix**: A segment that is short of a track is no longer served, which is what left a seek hanging with the proxy answering every request in 98 ms. A run that is terminated closes its current output file properly — trailing index and all — but the file holds only what had been muxed by then, and after a seek-restart that is routinely one track of two. Nothing about such a file looks unfinished: it exists, the next one exists, so the readiness rule called it done. Measured 2026-08-06 on a stuck session: segment #133 carried one `tfdt` where #131 and #134 carried two, and #132 was zero bytes. The fragments are already walked to stamp their timestamps, so counting the tracks in them costs nothing; a segment missing one is deleted and produced again.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@torrent-tv/proxy",
3
- "version": "2.9.121",
3
+ "version": "2.9.122",
4
4
  "description": "Torrent proxy client that exposes webseed-like HTTP stream endpoint.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "publishConfig": {
@@ -1454,7 +1454,18 @@ export class HlsSessionManager {
1454
1454
  `duration=${hasDuration ? formatSeconds(durationSeconds) : "unknown"} segments=${segmentCount}`
1455
1455
  );
1456
1456
 
1457
- await this.#startEncodeRun(session, 0);
1457
+ // Begin where the viewer asked, not at the top of the file. The position
1458
+ // was already honoured everywhere EXCEPT here: it went into the session key
1459
+ // and into the log line, and then the first run started at index 0 anyway.
1460
+ // Measured 2026-08-06 on a Retry after the proxy restarted — the session
1461
+ // was created with `start=1580s`, the encoder began at #0, the player
1462
+ // asked for #152, and 45 s later the browser gave up with "no data arrived
1463
+ // from the proxy" while the transcode ran happily at 9.9x through the
1464
+ // opening credits.
1465
+ const firstIndex = normalizedStartPosition > 0
1466
+ ? this.#segmentIndexForTime(session, normalizedStartPosition)
1467
+ : 0;
1468
+ await this.#startEncodeRun(session, firstIndex);
1458
1469
 
1459
1470
  try {
1460
1471
  await this.waitUntilReady(session);