feat: enhance playback service logging to debug R2 404 issues

This commit is contained in:
google-labs-jules[bot] committed 2026-01-14 17:56:11 +00:00
1 parent 175a6f73b4
commit 7b9781a3dd
1 file changed
+15 -1
+15 -1
View File
@@ -472,6 +472,13 @@ class PlaybackSession extends SimpleEventEmitter {
const httpsUrl = this.sanitizedUrl;
const webSeedCandidates = httpsUrl ? [httpsUrl] : [];
if (webSeedCandidates.length > 0) {
this.service.log(
`[playVideoWithFallback] Adding ${webSeedCandidates.length} web seed candidate(s) for fallback:`,
webSeedCandidates
);
}
let fallbackStarted = false;
const startTorrentFallback = async (reason) => {
if (fallbackStarted) {
@@ -610,13 +617,20 @@ class PlaybackSession extends SimpleEventEmitter {
const probeResult =
typeof probeUrl === "function" ? await probeUrl(httpsUrl) : null;
const probeOutcome = probeResult?.outcome || "error";
const probeStatus = probeResult?.status || "unknown";
const shouldAttemptHosted =
probeOutcome !== "bad" && probeOutcome !== "error";
this.service.log(
`[playVideoWithFallback] Hosted URL probe outcome=${probeOutcome} shouldAttemptHosted=${shouldAttemptHosted}`
`[playVideoWithFallback] Hosted URL probe outcome=${probeOutcome} status=${probeStatus} shouldAttemptHosted=${shouldAttemptHosted}`
);
if (probeOutcome === "bad") {
this.service.log(
`[playVideoWithFallback] ⚠️ Direct URL probe failed with status ${probeStatus}. WebSeed fallback using this same URL will likely also fail.`
);
}
if (shouldAttemptHosted) {
let outcomeResolved = false;
let outcomeResolver = () => {};