@torrent-tv/proxy 2.107.3 → 2.107.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@torrent-tv/proxy",
3
- "version": "2.107.3",
3
+ "version": "2.107.4",
4
4
  "description": "Torrent proxy client that exposes webseed-like HTTP stream endpoint.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "repository": {
@@ -11,6 +11,13 @@ import { logger } from "../../utils/logger.js";
11
11
  import { isOutputName, OutputSpec } from "../encode/output/index.js";
12
12
  import { withSubtitleReadiness } from "./subtitle-readiness.js";
13
13
 
14
+ /** @param {{ spec: { sourceFileIndexes: number[] }, file: { fileIndex: number } }} output */
15
+ export function sourceFileIndexesForOutput(output) {
16
+ return output.spec.sourceFileIndexes.length > 0
17
+ ? [...output.spec.sourceFileIndexes]
18
+ : [output.file.fileIndex];
19
+ }
20
+
14
21
  /**
15
22
  * The segment number an assignment is recorded under for this file, −1 for the
16
23
  * init, or null for anything that is neither (a playlist).
@@ -1044,7 +1051,8 @@ export class ViewerRequests {
1044
1051
  subtitle ? this.#host.subtitleReadyFor?.(viewer) !== false : true);
1045
1052
  forecast.operations = outputs.flatMap((output, index) => {
1046
1053
  const common = { speed: this.#host.playbackReadiness.forecastRate(tracks[index].readings, now, 0, "piece"),
1047
- processedSeconds: tracks[index].processedSeconds };
1054
+ processedSeconds: tracks[index].processedSeconds,
1055
+ sourceFileIndexes: sourceFileIndexesForOutput(output) };
1048
1056
  return [
1049
1057
  ...(output.spec.video ? [{ ...common, track: "video",
1050
1058
  operation: output.spec.transcodesVideo ? "encode" : "copy",