aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <3226626+ksooo@users.noreply.github.com>2024-07-04 21:13:02 +0200
committerGitHub <noreply@github.com>2024-07-04 21:13:02 +0200
commit8642d8ca68fa91efa605a7dfaabffc0c2034b7ae (patch)
treeeae4d0814f715cb872d601cdbd00b9241a6535db
parent5020e13d6b1693688e0eb65131a235184e317adc (diff)
parentefc508d5d1d8927fde504345991f61b7bb3ee7b7 (diff)
Merge pull request #25413 from ksooo/pvr-fix-reminders-update
[PVR] Fix Reminders update special cases
-rw-r--r--xbmc/pvr/timers/PVRTimers.cpp39
1 files changed, 31 insertions, 8 deletions
diff --git a/xbmc/pvr/timers/PVRTimers.cpp b/xbmc/pvr/timers/PVRTimers.cpp
index 53be1a9269..8339da75b7 100644
--- a/xbmc/pvr/timers/PVRTimers.cpp
+++ b/xbmc/pvr/timers/PVRTimers.cpp
@@ -550,6 +550,29 @@ 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())
+ {
+ // epg event no longer present. delete the timer
+ bDeleteTimer = true;
+ timer->DeleteFromDatabase();
}
}
}
@@ -645,6 +668,13 @@ bool CPVRTimers::UpdateEntries(int iMaxNotificationDelay)
++it;
}
+ // reinsert timers with changed timer start
+ for (const auto& timer : timersToReinsert)
+ {
+ InsertEntry(timer);
+ timer->Persist();
+ }
+
// create new children of local epg-based reminder timer rules
for (const auto& epgMapEntry : epgMap)
{
@@ -671,14 +701,7 @@ bool CPVRTimers::UpdateEntries(int iMaxNotificationDelay)
}
}
- // reinsert timers with changed timer start
- for (const auto& timer : timersToReinsert)
- {
- InsertEntry(timer);
- timer->Persist();
- }
-
- // insert new children of time-based local timer rules
+ // persist and insert/update new children of local time-based and epg-based reminder timer rules
for (const auto& timerPair : childTimersToInsert)
{
PersistAndUpdateLocalTimer(timerPair.second, timerPair.first);