@torrent-tv/proxy 2.107.85 → 2.107.87

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.107.85",
3
+ "version": "2.107.87",
4
4
  "description": "Torrent proxy client that exposes webseed-like HTTP stream endpoint.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "repository": {
@@ -1156,9 +1156,13 @@ export class EncodeRuns {
1156
1156
  startSeconds,
1157
1157
  // Where piece `index` ends on the timeline `startSeconds` is taken from:
1158
1158
  // the speed reading is the film between two such ends (torrent-tv/meta#414).
1159
- pieceEndSeconds: (index) => Number.isInteger(index) && index >= 0 && index + 1 < session.timeline.published.length
1160
- ? session.timeline.publishedStartOf(index + 1)
1161
- : Number(session.file.durationSeconds) || null,
1159
+ pieceEndSeconds: (index) => {
1160
+ const count = session.timeline.segmentCount;
1161
+ if (!Number.isInteger(index) || index < 0 || index >= count) return null;
1162
+ return index + 1 < count
1163
+ ? session.timeline.publishedStartOf(index + 1)
1164
+ : Number(session.file.durationSeconds) || null;
1165
+ },
1162
1166
  totalSeconds: Number(session.file.durationSeconds) || null,
1163
1167
  spawn: (spawnArgs) =>
1164
1168
  spawn(this.#host.ffmpegBin, spawnArgs, {