diff options
author | ksooo <3226626+ksooo@users.noreply.github.com> | 2024-10-04 12:49:35 +0200 |
---|---|---|
committer | ksooo <3226626+ksooo@users.noreply.github.com> | 2024-10-11 21:31:31 +0200 |
commit | a5c3649c69b009a9334435b1b08af981e402d39b (patch) | |
tree | 9246947bb170012aaf7ecef1b42991f662af0ed2 | |
parent | 741f0604fddf1a33aca00c88f6d148f3723c62e9 (diff) |
[PVR] Support to the second duration when creating time-based timers (before it was full minutes only).
-rw-r--r-- | xbmc/pvr/guilib/PVRGUIActionsTimers.cpp | 4 | ||||
-rw-r--r-- | xbmc/pvr/timers/PVRTimerInfoTag.cpp | 9 | ||||
-rw-r--r-- | xbmc/pvr/timers/PVRTimers.cpp | 6 |
3 files changed, 10 insertions, 9 deletions
diff --git a/xbmc/pvr/guilib/PVRGUIActionsTimers.cpp b/xbmc/pvr/guilib/PVRGUIActionsTimers.cpp index 570249b12a..582a3174f1 100644 --- a/xbmc/pvr/guilib/PVRGUIActionsTimers.cpp +++ b/xbmc/pvr/guilib/PVRGUIActionsTimers.cpp @@ -562,7 +562,7 @@ bool CPVRGUIActionsTimers::SetRecordingOnChannel(const std::shared_ptr<CPVRChann const std::shared_ptr<CPVRTimerInfoTag> newTimer( epgTag ? CPVRTimerInfoTag::CreateFromEpg(epgTag, false) - : CPVRTimerInfoTag::CreateInstantTimerTag(channel, iDuration)); + : CPVRTimerInfoTag::CreateInstantTimerTag(channel, iDuration * 60)); if (newTimer) bReturn = CServiceBroker::GetPVRManager().Timers()->AddTimer(newTimer); @@ -984,7 +984,7 @@ void CPVRGUIActionsTimers::AnnounceReminder(const std::shared_ptr<CPVRTimerInfoT } else { - int iDuration = (timer->EndAsUTC() - timer->StartAsUTC()).GetSecondsTotal() / 60; + const int iDuration{(timer->EndAsUTC() - timer->StartAsUTC()).GetSecondsTotal()}; newTimer = CPVRTimerInfoTag::CreateTimerTag(timer->Channel(), timer->StartAsUTC(), iDuration); } diff --git a/xbmc/pvr/timers/PVRTimerInfoTag.cpp b/xbmc/pvr/timers/PVRTimerInfoTag.cpp index 6f5ea746ea..9c49d9d850 100644 --- a/xbmc/pvr/timers/PVRTimerInfoTag.cpp +++ b/xbmc/pvr/timers/PVRTimerInfoTag.cpp @@ -791,7 +791,7 @@ std::shared_ptr<CPVRTimerInfoTag> CPVRTimerInfoTag::CreateFromDate( if (bInstantStart) epgTag = channel->GetEPGNow(); else if (channel->GetEPG()) - epgTag = channel->GetEPG()->GetTagBetween(start, start + CDateTimeSpan(0, 0, iDuration, 0)); + epgTag = channel->GetEPG()->GetTagBetween(start, start + CDateTimeSpan(0, 0, 0, iDuration)); } std::shared_ptr<CPVRTimerInfoTag> newTimer; @@ -853,16 +853,17 @@ std::shared_ptr<CPVRTimerInfoTag> CPVRTimerInfoTag::CreateFromDate( if (iDuration == DEFAULT_PVRRECORD_INSTANTRECORDTIME) iDuration = CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt( - CSettings::SETTING_PVRRECORD_INSTANTRECORDTIME); + CSettings::SETTING_PVRRECORD_INSTANTRECORDTIME) * + 60; if (bInstantStart) { - CDateTime endTime = now + CDateTimeSpan(0, 0, iDuration ? iDuration : 120, 0); + const CDateTime endTime{now + CDateTimeSpan(0, 0, 0, iDuration ? iDuration : 2 * 60 * 60)}; newTimer->SetEndFromUTC(endTime); } else { - CDateTime endTime = start + CDateTimeSpan(0, 0, iDuration ? iDuration : 120, 0); + const CDateTime endTime{start + CDateTimeSpan(0, 0, 0, iDuration ? iDuration : 2 * 60 * 60)}; newTimer->SetEndFromUTC(endTime); } diff --git a/xbmc/pvr/timers/PVRTimers.cpp b/xbmc/pvr/timers/PVRTimers.cpp index ccf719091a..a6d0ae395d 100644 --- a/xbmc/pvr/timers/PVRTimers.cpp +++ b/xbmc/pvr/timers/PVRTimers.cpp @@ -635,8 +635,8 @@ bool CPVRTimers::UpdateEntries(int iMaxNotificationDelay) { const CDateTimeSpan duration = timer->EndAsUTC() - timer->StartAsUTC(); const std::shared_ptr<CPVRTimerInfoTag> childTimer = - CPVRTimerInfoTag::CreateReminderFromDate( - nextStart, duration.GetSecondsTotal() / 60, timer); + CPVRTimerInfoTag::CreateReminderFromDate(nextStart, duration.GetSecondsTotal(), + timer); if (childTimer) { bChanged = true; @@ -1062,7 +1062,7 @@ bool CPVRTimers::AddLocalTimer(const std::shared_ptr<CPVRTimerInfoTag>& tag, boo { const CDateTimeSpan duration = persistedTimer->EndAsUTC() - persistedTimer->StartAsUTC(); const std::shared_ptr<CPVRTimerInfoTag> childTimer = - CPVRTimerInfoTag::CreateReminderFromDate(nextStart, duration.GetSecondsTotal() / 60, + CPVRTimerInfoTag::CreateReminderFromDate(nextStart, duration.GetSecondsTotal(), persistedTimer); if (childTimer) { |