diff options
author | ksooo <3226626+ksooo@users.noreply.github.com> | 2024-06-29 17:55:55 +0200 |
---|---|---|
committer | ksooo <3226626+ksooo@users.noreply.github.com> | 2024-07-10 09:01:37 +0200 |
commit | 4b20052e59dff894ca111c0027aab5c809b7618c (patch) | |
tree | 078a364e4716fe3c427497b3c281950148e220d8 | |
parent | 05b84b6e20c910d7c6e1cfe76c7f4a9a90c59ce8 (diff) |
[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.
-rw-r--r-- | xbmc/pvr/timers/PVRTimers.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xbmc/pvr/timers/PVRTimers.cpp b/xbmc/pvr/timers/PVRTimers.cpp index b01e678209..9c848239dc 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<CPVRTimerInfoTag> 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()) { |