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.
This commit is contained in:
Emilien 2026-06-26 18:08:58 +02:00
parent b80ac061b9
commit 24182a28d5

View File

@ -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