From 8e09ad746107be596e0478bb3bbf4bcf24b5466e Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Thu, 1 Feb 2024 20:44:36 +0000 Subject: [PATCH] Support catchup-id for live URLs where possible --- src/iptvsimple/CatchupController.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/iptvsimple/CatchupController.cpp b/src/iptvsimple/CatchupController.cpp index 84a70306..b5a21c3c 100644 --- a/src/iptvsimple/CatchupController.cpp +++ b/src/iptvsimple/CatchupController.cpp @@ -34,9 +34,11 @@ void CatchupController::ProcessChannelForPlayback(const Channel& channel, std::m // Anything from here is live! m_playbackIsVideo = false; // TODO: possible time jitter on UI as this will effect get stream times + //Always get the live EPG entry + EpgEntry* liveEpgEntry = GetLiveEPGEntry(channel); + if (!m_fromEpgTag || m_controlsLiveStream) { - EpgEntry* liveEpgEntry = GetLiveEPGEntry(channel); if (m_controlsLiveStream && liveEpgEntry && !m_settings->CatchupOnlyOnFinishedProgrammes()) { // Live timeshifting support with EPG entry @@ -52,6 +54,7 @@ void CatchupController::ProcessChannelForPlayback(const Channel& channel, std::m m_catchupStartTime = 0; m_catchupEndTime = 0; } + m_fromEpgTag = false; } @@ -61,6 +64,11 @@ void CatchupController::ProcessChannelForPlayback(const Channel& channel, std::m { m_resetCatchupState = false; m_programmeCatchupId.clear(); + + // Not from timeshifted EPG so safe to set the catchup ID here + if (liveEpgEntry) + m_programmeCatchupId = liveEpgEntry->GetCatchupId(); + if (channel.IsCatchupSupported()) { m_timeshiftBufferOffset = channel.GetCatchupDaysInSeconds(); //offset from now to start of catchup window