@torrent-tv/proxy 2.105.6 → 2.105.7

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.105.6",
3
+ "version": "2.105.7",
4
4
  "description": "Torrent proxy client that exposes webseed-like HTTP stream endpoint.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "repository": {
@@ -76,7 +76,14 @@ export class SubtitleOrchestrator {
76
76
  endSeconds: packet.duration > 0 ? packet.pts + packet.duration : null, text };
77
77
  pending.push({ identity, cue });
78
78
  }
79
- if (params.isCurrent?.() === false || this.#packetCues.get(key) !== state) {
79
+ // A cue read from the file is a fact about the file, not about where
80
+ // the viewer stood when the read began. A position report moves that
81
+ // stand every 1.5 s, so a read that crossed one used to throw away the
82
+ // cues it had read, and those lines never reached the page
83
+ // (torrent-tv/meta#7). They are kept and published; only a forgotten
84
+ // source cannot take them.
85
+ const obsolete = params.isCurrent?.() === false;
86
+ if (this.#packetCues.get(key) !== state) {
80
87
  return { kind: "terminal", reason: "request-obsolete", requestId };
81
88
  }
82
89
  state.ready = true;
@@ -96,7 +103,7 @@ export class SubtitleOrchestrator {
96
103
  }
97
104
  }
98
105
  const fresh = TextSubtitleTrack.finalizeCues(ordered(), track.codecId).filter(cue => !previous.has(cue.seq));
99
- if (fresh.length && params.isCurrent?.() !== false) {
106
+ if (fresh.length) {
100
107
  const cues = fresh;
101
108
  this.cues.publish?.({ sourceKey: params.sourceKey, fileIndex: params.fileIndex,
102
109
  trackIndex: track.declaredIndex, cues, withdrawn, language: track.language ?? "",
@@ -104,6 +111,7 @@ export class SubtitleOrchestrator {
104
111
  cursor: state.cursor, spanStartSeconds: cues[0]?.startSeconds ?? null,
105
112
  spanEndSeconds: cues.at(-1)?.endSeconds ?? null, walkedClusters: 0, indexedClusters: 0 });
106
113
  }
114
+ if (obsolete) return { kind: "terminal", reason: "request-obsolete", requestId };
107
115
  result = { kind: "result", value: { cues: [...state.packets.values()], track, coveredClusters: 0, indexedClusters: 0 }, requestId };
108
116
  }
109
117
  } catch (error) {