From 24182a28d538af96d646e737c14f1f25fdb507c2 Mon Sep 17 00:00:00 2001 From: Emilien <4016501+unixfox@users.noreply.github.com> Date: Fri, 26 Jun 2026 18:08:58 +0200 Subject: [PATCH] Fix live_now detection to not override false with nil via ||= ||= with false then nil resets live_now to nil in Crystal. Use explicit nil checks instead to preserve false values from microformat.isLiveNow for scheduled streams. --- src/invidious/videos/parser.cr | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/invidious/videos/parser.cr b/src/invidious/videos/parser.cr index 72965c79..db5c0594 100644 --- a/src/invidious/videos/parser.cr +++ b/src/invidious/videos/parser.cr @@ -282,8 +282,9 @@ If you are the administrator, install Invidious Companion: \ live_now = microformat.dig?("liveBroadcastDetails", "isLiveNow") .try &.as_bool - live_now ||= video_details.dig?("isLive").try &.as_bool - live_now ||= video_primary_renderer.try &.dig?("viewCount", "videoViewCountRenderer", "isLive").try &.as_bool || false + live_now = video_details.dig?("isLive").try &.as_bool if live_now.nil? + live_now = video_primary_renderer.try &.dig?("viewCount", "videoViewCountRenderer", "isLive").try &.as_bool if live_now.nil? + live_now ||= false post_live_dvr = video_details.dig?("isPostLiveDvr") .try &.as_bool || false