From d9fd7760e74713503fc16c6aece4def0bc2bae83 Mon Sep 17 00:00:00 2001 From: ksooo <3226626+ksooo@users.noreply.github.com> Date: Sat, 29 Jun 2024 17:55:55 +0200 Subject: [PVR] Fix CPVRTimers::UpdateEntries: Delete existing epg-based local timers if the respective EPG tag was re-used for an unrelated event that no longer matches the related timer rule. --- xbmc/pvr/timers/PVRTimers.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/xbmc/pvr/timers/PVRTimers.cpp b/xbmc/pvr/timers/PVRTimers.cpp index 91dd76481c..440f33e57f 100644 --- a/xbmc/pvr/timers/PVRTimers.cpp +++ b/xbmc/pvr/timers/PVRTimers.cpp @@ -550,6 +550,23 @@ bool CPVRTimers::UpdateEntries(int iMaxNotificationDelay) timer->Persist(); } } + + // check for epg tag uids that were re-used for a different event (which is actually + // an add-on/a backend bug) + if (!timer->IsTimerRule() && (epgTag->Title() != timer->Title())) + { + const std::shared_ptr parent{GetTimerRule(timer)}; + if (parent) + { + const CPVRTimerRuleMatcher matcher{parent, now}; + if (!matcher.Matches(epgTag)) + { + // epg event no longer matches the rule. delete the timer + bDeleteTimer = true; + timer->DeleteFromDatabase(); + } + } + } } else if (!timer->IsTimerRule()) { -- cgit v1.2.3