[pvr] fixed canceling the active timer on a channel in certain situations
authorLars Op den Kamp <lars@opdenkamp.eu>
Tue, 8 Jan 2013 01:51:26 +0000 (02:51 +0100)
committerS. Davilla <davilla@4pi.com>
Wed, 9 Jan 2013 14:04:36 +0000 (09:04 -0500)
xbmc/pvr/PVRManager.cpp
xbmc/pvr/timers/PVRTimers.cpp

index a41ae0a..4b36ddb 100644 (file)
@@ -746,7 +746,7 @@ bool CPVRManager::StartRecordingOnPlayingChannel(bool bOnOff)
     else if (!bOnOff && channel->IsRecording())
     {
       /* delete active timers */
-      bReturn = m_timers->DeleteTimersOnChannel(*channel, false, true);
+      bReturn = m_timers->DeleteTimersOnChannel(*channel, true, true);
     }
   }
 
index c51cf77..f22cf21 100644 (file)
@@ -441,12 +441,9 @@ bool CPVRTimers::DeleteTimersOnChannel(const CPVRChannel &channel, bool bDeleteR
     {
       for (vector<CPVRTimerInfoTagPtr>::iterator timerIt = it->second->begin(); timerIt != it->second->end(); )
       {
-        bool bDeleteActiveItem = !bCurrentlyActiveOnly ||
-            (CDateTime::GetCurrentDateTime() > (*timerIt)->StartAsLocalTime() &&
-             CDateTime::GetCurrentDateTime() < (*timerIt)->EndAsLocalTime());
+        bool bDeleteActiveItem = !bCurrentlyActiveOnly || (*timerIt)->IsRecording();
         bool bDeleteRepeatingItem = bDeleteRepeating || !(*timerIt)->m_bIsRepeating;
-        bool bChannelsMatch = (*timerIt)->ChannelNumber() == channel.ChannelNumber() &&
-            (*timerIt)->m_bIsRadio == channel.IsRadio();
+        bool bChannelsMatch = *(*timerIt)->ChannelTag() == channel;
 
         if (bDeleteActiveItem && bDeleteRepeatingItem && bChannelsMatch)
         {