@torrent-tv/proxy 2.107.15 → 2.107.17
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
|
@@ -41,7 +41,7 @@ function sameInputs(left, right) {
|
|
|
41
41
|
return left.every((input, index) => input.sourceId === right[index].sourceId && input.ranges === right[index].ranges);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
function forecastInputState(tracks, identity) {
|
|
44
|
+
export function forecastInputState(tracks, identity) {
|
|
45
45
|
if (!identity) return null;
|
|
46
46
|
const track = tracks.find(candidate => candidate.id === identity.trackId);
|
|
47
47
|
const segment = track?.segments.find(candidate => candidate.index === identity.segmentIndex);
|
|
@@ -51,6 +51,9 @@ function forecastInputState(tracks, identity) {
|
|
|
51
51
|
trackId: identity.trackId,
|
|
52
52
|
segmentIndex: identity.segmentIndex,
|
|
53
53
|
phase: identity.phase,
|
|
54
|
+
trackFound: Boolean(track),
|
|
55
|
+
segmentFound: Boolean(segment),
|
|
56
|
+
sourceInputFound: Boolean(sourceInput),
|
|
54
57
|
rangesKnown: Array.isArray(sourceInput?.ranges),
|
|
55
58
|
rangeCount: Array.isArray(sourceInput?.ranges) ? sourceInput.ranges.length : null
|
|
56
59
|
};
|
|
@@ -1121,7 +1124,8 @@ export class ViewerRequests {
|
|
|
1121
1124
|
const previousInputState = measurement.forecastInputState ?? null;
|
|
1122
1125
|
const currentInputState = forecastInputState(tracks, unavailableInput);
|
|
1123
1126
|
if (previousInputState && forecastInputIdentity(previousInputState) !== forecastInputIdentity(currentInputState)) {
|
|
1124
|
-
|
|
1127
|
+
const resolvedInputState = forecastInputState(tracks, previousInputState) ?? previousInputState;
|
|
1128
|
+
observeForecastInput(this.#host.observeWait, session.file.sourceKey, resolvedInputState,
|
|
1125
1129
|
currentInputState ? "forecast-blocker-replaced" : "forecast-blocker-cleared");
|
|
1126
1130
|
}
|
|
1127
1131
|
if (currentInputState && JSON.stringify(previousInputState) !== JSON.stringify(currentInputState)) {
|
|
@@ -85,7 +85,8 @@ export class SourcePreparation {
|
|
|
85
85
|
|
|
86
86
|
/** Current owners determine priority; old work never restores a withdrawn read. */
|
|
87
87
|
demandFor(work) {
|
|
88
|
-
if (work.role === "source-rest" && !this.#
|
|
88
|
+
if (work.role === "source-rest" && (!this.#playbackAppliedFor(work.sourceKey, work.fileIndex) ||
|
|
89
|
+
!this.#sourceRestNeededFor(work.sourceKey, work.fileIndex))) return null;
|
|
89
90
|
const handoffFileIndex = work.selected || (work.role === "source-rest" && work.ownerFileIndex === work.fileIndex)
|
|
90
91
|
? work.fileIndex : null;
|
|
91
92
|
const opening = Number.isInteger(handoffFileIndex) && this.#viewers.forSource(work.sourceKey).some(viewer =>
|