aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <3226626+ksooo@users.noreply.github.com>2024-07-10 10:56:35 +0200
committerGitHub <noreply@github.com>2024-07-10 10:56:35 +0200
commit72c9107cce9d1d7145dd4af245bf4f7f23af2e99 (patch)
tree824a706361ac3919f13bafa259ef6f6b7231b7e2
parent6186114acf4354697317b64d4a75f72eebf353dc (diff)
parent50dde2a959d5ced1569a26abf4bb956512c1cc1e (diff)
Merge pull request #25469 from ksooo/pvr-fix-reminders-update-omega
[Omega] [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 3f98227fa4..a2b9e91c70 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);