From b563155a376817b8f5fe57940b0fa7e2c74934a0 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Sun, 30 Aug 2026 15:18:26 +0200 Subject: [PATCH] docs(plex): correct the cull-yield fallback comment to name the real route 404s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deep-review round 3: the only surviving finding — a comment-drift nit. The fallback's cull-yield comment named the route's 'Not available yet' path, but a culled-key segment request actually returns 'No active playback session' (the substantive invariant — never a None that 404s as file-not-found — is unchanged). Reworded to match the route. Concurrency + correctness came back clean. --- backend/app/plex/stream.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/app/plex/stream.py b/backend/app/plex/stream.py index f404fac0..8727d1a3 100644 --- a/backend/app/plex/stream.py +++ b/backend/app/plex/stream.py @@ -667,9 +667,11 @@ def start_session( ) respawned = _spawn(False, False, replace_only=s) if respawned is None: - # Superseded/culled mid-fallback — yield the session registered now (a newer seek-restart), or - # our own now-dead session if the key was cap-culled (its segment requests degrade to the - # route's retryable "not available yet", never a dishonest "file not found" from a None). + # Superseded/culled mid-fallback — yield whoever is registered now (a newer seek-restart), or + # our own now-dead session if the key was cap-culled. Never None here: the POST /session route + # turns a None return into a "Media file not found on disk" 404 — dishonest for a file that + # exists. A (dead) session instead degrades to a retryable 404 ("No active playback session" / + # "Not available yet") the client re-requests. return current_session(key) or s s = respawned ready = wait_for(_seg(0), timeout=25.0, proc=s.proc)