From efc508d5d1d8927fde504345991f61b7bb3ee7b7 Mon Sep 17 00:00:00 2001 From: ksooo <3226626+ksooo@users.noreply.github.com> Date: Sat, 29 Jun 2024 21:04:03 +0200 Subject: [PVR] Fix CPVRTimers::UpdateEntries: Re-insert timers with changed start time before checking whether new children for local timer rules need to be created. The timers with changed start time need to be found during that check. This fixes creation of duplicate timers. --- xbmc/pvr/timers/PVRTimers.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xbmc/pvr/timers/PVRTimers.cpp b/xbmc/pvr/timers/PVRTimers.cpp index 440f33e57f..8339da75b7 100644 --- a/xbmc/pvr/timers/PVRTimers.cpp +++ b/xbmc/pvr/timers/PVRTimers.cpp @@ -668,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) { @@ -694,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); -- cgit v1.2.3