@torrent-tv/proxy 2.87.0 → 2.87.1
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 +4 -0
- package/CLAUDE.md +8 -4
- package/docs/browser-proxy-contract.md +94 -0
- package/package.json +1 -1
- package/routes/api/transcode-sessions/post.js +1 -1
- package/routes/transcode/audio-file/get.js +1 -1
- package/routes/transcode/audio-warm/get.js +1 -1
- package/routes/transcode/session-file/get.js +6 -383
- package/routes/transcode/variant-file/get.js +2 -3
- package/routes/transcode/variant-warm/get.js +2 -1
- package/services/encode/EncodeOrchestrator.js +23 -13
- package/services/encode/EncodeRuns.js +15 -5
- package/services/encode/OutputOpening.js +16 -6
- package/services/encode/quality/QualityController.js +6 -2
- package/services/server/http-responses.js +60 -0
- package/services/server/transcode-session-files.js +325 -0
- package/services/server/wire-outputs.js +29 -4
- package/test/coverage-follows-the-disk.test.js +6 -1
- package/test/encoded-output.test.js +1 -1
|
@@ -227,6 +227,31 @@ export function wireOutputs({
|
|
|
227
227
|
memoryClaimant = null,
|
|
228
228
|
budgetPolicy = null}) {
|
|
229
229
|
const parts = {};
|
|
230
|
+
// Encode components receive only the storage operations they use. The
|
|
231
|
+
// concrete SegmentStore remains owned by this assembly and is never handed
|
|
232
|
+
// to the encode layer.
|
|
233
|
+
const segmentCoverage = {
|
|
234
|
+
provenNumbers: (address) => parts.segmentStore.provenNumbers(address),
|
|
235
|
+
announce: (address, index) => parts.segmentStore.announce(address, index),
|
|
236
|
+
filesHeld: (address) => parts.segmentStore.filesHeld(address),
|
|
237
|
+
clearUpAfter: (address, startedAt) => parts.segmentStore.clearUpAfter(address, startedAt)
|
|
238
|
+
};
|
|
239
|
+
const segmentFiles = {
|
|
240
|
+
pathFor: (address) => parts.segmentStore.pathFor(address),
|
|
241
|
+
initOf: (address) => parts.segmentStore.initOf(address),
|
|
242
|
+
directoryFor: (address) => parts.segmentStore.directoryFor(address),
|
|
243
|
+
publish: (address, makingName, format) => parts.segmentStore.publish(address, makingName, format)
|
|
244
|
+
};
|
|
245
|
+
const segmentOutputFiles = {
|
|
246
|
+
addresses: () => parts.segmentStore.addresses(),
|
|
247
|
+
isClosed: (address, index) => parts.segmentStore.isClosed(address, index),
|
|
248
|
+
lastReadAt: (address) => parts.segmentStore.lastReadAt(address),
|
|
249
|
+
directoryFor: (address) => parts.segmentStore.directoryFor(address),
|
|
250
|
+
useFormat: (address, format) => parts.segmentStore.useFormat(address, format)
|
|
251
|
+
};
|
|
252
|
+
const segmentPaths = {
|
|
253
|
+
pathOf: (address, index) => parts.segmentStore.pathOf(address, index)
|
|
254
|
+
};
|
|
230
255
|
/**
|
|
231
256
|
* Whether everything this output will ever serve is made: every segment of
|
|
232
257
|
* its timeline closed in the store. Such an output needs no encoder and
|
|
@@ -298,7 +323,7 @@ export function wireOutputs({
|
|
|
298
323
|
get outputs() { return parts.outputs; },
|
|
299
324
|
get priority() { return parts.priority; },
|
|
300
325
|
get segmentDurationSec() { return parts.segmentDurationSec; },
|
|
301
|
-
|
|
326
|
+
segmentFiles,
|
|
302
327
|
get videoEncoder() { return parts.encoders.current; },
|
|
303
328
|
get encoders() { return parts.encoders; },
|
|
304
329
|
invalidateWaits: (output) => parts.serving.invalidateWaits(output),
|
|
@@ -496,7 +521,7 @@ export function wireOutputs({
|
|
|
496
521
|
get returns() { return parts.returns; },
|
|
497
522
|
get segmentDurationSec() { return parts.segmentDurationSec; },
|
|
498
523
|
get segmentFormat() { return parts.segmentFormat; },
|
|
499
|
-
|
|
524
|
+
segmentOutputFiles,
|
|
500
525
|
get softwarePresetBenchmark() { return parts.softwarePresetBenchmark; },
|
|
501
526
|
get sourceFiles() { return parts.sourceFiles; },
|
|
502
527
|
get timelines() { return parts.timelines; },
|
|
@@ -848,7 +873,7 @@ export function wireOutputs({
|
|
|
848
873
|
segmentSeconds: parts.segmentDurationSec,
|
|
849
874
|
contentionPenalties: parts.contentionPenalties,
|
|
850
875
|
startingSpeedFor: (address) => parts.encodeCost.speedForOutput(address),
|
|
851
|
-
|
|
876
|
+
segmentCoverage,
|
|
852
877
|
// HOW IT ASKS TO DECIDE AGAIN. A plan that refuses to place anything
|
|
853
878
|
// because an output's input is away needs something to bring it back:
|
|
854
879
|
// nothing about the state changes while the data is missing, so no event
|
|
@@ -946,7 +971,7 @@ export function wireOutputs({
|
|
|
946
971
|
get outputs() { return parts.outputs; },
|
|
947
972
|
get qualityOffer() { return parts.qualityOffer; },
|
|
948
973
|
get segmentDurationSec() { return parts.segmentDurationSec; },
|
|
949
|
-
|
|
974
|
+
segmentPaths,
|
|
950
975
|
get videoEncoder() { return parts.encoders.current; },
|
|
951
976
|
});
|
|
952
977
|
parts.budgetTimer = setInterval(() => {
|
|
@@ -70,7 +70,12 @@ function orchestratorWithAStore() {
|
|
|
70
70
|
firstByteWaitSec: 0.12,
|
|
71
71
|
refetchSecPerFilmSecond: () => 0.25,
|
|
72
72
|
startingSpeedFor: () => 2,
|
|
73
|
-
|
|
73
|
+
segmentCoverage: {
|
|
74
|
+
provenNumbers: (address) => store.provenNumbers(address),
|
|
75
|
+
announce: (address, index) => store.announce(address, index),
|
|
76
|
+
filesHeld: (address) => store.filesHeld(address),
|
|
77
|
+
clearUpAfter: (address, startedAt) => store.clearUpAfter(address, startedAt)
|
|
78
|
+
},
|
|
74
79
|
now: () => 1000,
|
|
75
80
|
logger,
|
|
76
81
|
makeRun: ({ address, from, to }) => new EncodeRun({
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Decided with the user 2026-09-16: which pieces are made is the segment
|
|
5
5
|
* store's, and which encoders run is the encoding orchestrator's. A second
|
|
6
|
-
* holder of either is how
|
|
6
|
+
* holder of either is how the stale second owner stopped playback outright.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import test from "node:test";
|