@torrent-tv/proxy 2.100.9 → 2.100.10

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.100.9",
3
+ "version": "2.100.10",
4
4
  "description": "Torrent proxy client that exposes webseed-like HTTP stream endpoint.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "repository": {
@@ -502,21 +502,13 @@ export class QualityController {
502
502
  remainingSec: Number.isFinite(buffer?.positionSec) && session.file?.durationSeconds > 0
503
503
  ? Math.max(0, session.file.durationSeconds - buffer.positionSec) : null
504
504
  });
505
- // A viewer whose picture has not moved yet — at the start or after a seek —
506
- // is held for the material a draining buffer would run out of, while their
507
- // buffer grows: the trend says nothing about them. The same two reasons
508
- // then decide. Held this way on Home Assistant, a picture made at 0.92-0.96x
509
- // was moved to a faster setting 11 s after the start, which had waited 30 s
510
- // for it (r70, torrent-tv/meta#178).
511
- const held = !threat && buffer?.waiting === true;
512
- if (!threat && !held) {
505
+ if (!threat) {
513
506
  return false;
514
507
  }
515
- const why = held ? "their picture is held" : "their buffer is draining";
516
508
  // Whatever else happens, a step UP prepared for them is not what they need.
517
- this.#dropUpAsk(session, consumerId, why);
509
+ this.#dropUpAsk(session, consumerId, "their buffer is draining");
518
510
  if (this.#host.sameHeightSwitchDirection(consumerId) === "up") {
519
- this.#host.cancelSameHeightSwitch(consumerId, why);
511
+ this.#host.cancelSameHeightSwitch(consumerId, "their buffer is draining");
520
512
  }
521
513
  const report = this.#host.linkReportOf(session, consumerId);
522
514
  const observed = report ? await this.observedStreamMbps(session) : null;
@@ -532,8 +524,7 @@ export class QualityController {
532
524
  const reasonText =
533
525
  (linkShort ? `link=${report.linkMbps.toFixed(2)}Mbps stream=${observed.toFixed(2)}Mbps ` : "") +
534
526
  (machineShort ? `CPU-bound speed=${speed.toFixed(2)}x ` : "") +
535
- `buffer=${(buffer?.bufferedSec ?? 0).toFixed(1)}s ` +
536
- (held ? "held before it moves " : `empty in ${secondsToEmpty === null ? "?" : secondsToEmpty.toFixed(1)}s `) +
527
+ `buffer=${(buffer?.bufferedSec ?? 0).toFixed(1)}s empty in ${secondsToEmpty === null ? "?" : secondsToEmpty.toFixed(1)}s ` +
537
528
  `for ${consumerId}`;
538
529
  if (linkShort) {
539
530
  const move = await this.#host.prepareSameHeightSwitch(session, consumerId, "down", `viewer-link-bound ${reasonText}`);
@@ -327,7 +327,7 @@ export function visiblePictureOf(viewers, output, consumerId) {
327
327
  * @param {object} output
328
328
  * @param {string} consumerId
329
329
  * @param {number} spanSec - The segment duration of the output they watch.
330
- * @returns {{ bufferedSec: number, slope: number | null, reportGapSec: number, positionSec: number | null, waiting: boolean } | null}
330
+ * @returns {{ bufferedSec: number, slope: number | null, reportGapSec: number } | null}
331
331
  * Null for nobody of that name; `slope` null while their reports do not yet
332
332
  * span one segment.
333
333
  */
@@ -339,9 +339,7 @@ export function bufferOf(viewers, output, consumerId, spanSec) {
339
339
  const trend = viewer.bufferTrend(spanSec);
340
340
  const held = Number.isFinite(viewer.bufferedSeconds) ? Math.max(0, viewer.bufferedSeconds) : 0;
341
341
  return { bufferedSec: held, slope: trend?.slope ?? null, reportGapSec: trend?.reportGapSec ?? 0,
342
- positionSec: viewer.positionSeconds() ?? null,
343
- // Blocked on material owed to them, with their picture not moving.
344
- waiting: viewer.waiting === true && viewer.playing !== true };
342
+ positionSec: viewer.positionSeconds() ?? null };
345
343
  }
346
344
 
347
345
  /**