diff options
author | Kai Sommerfeld <kai.sommerfeld@gmx.com> | 2019-02-06 17:14:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-06 17:14:16 +0100 |
commit | 56d92c596daf8980bf26a044a724be82b9dd1629 (patch) | |
tree | 2dcaff6da32baf4f4ba30d3d614c83f17ea96eb2 | |
parent | cde4b1df5cb378f71195f6cff7bce209dcba2c71 (diff) | |
parent | f2326740dbc556a8ed4657042f423a08bc650f58 (diff) |
Merge pull request #15443 from ksooo/pvr-fix-recording-isinprogress
[PVR] Fix CPVRTimers::GetRecordingTimerForRecording to respect timer'…
-rw-r--r-- | xbmc/pvr/timers/PVRTimers.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/xbmc/pvr/timers/PVRTimers.cpp b/xbmc/pvr/timers/PVRTimers.cpp index b2f81725a1..ddc6267dec 100644 --- a/xbmc/pvr/timers/PVRTimers.cpp +++ b/xbmc/pvr/timers/PVRTimers.cpp @@ -796,11 +796,19 @@ CPVRTimerInfoTagPtr CPVRTimers::GetRecordingTimerForRecording(const CPVRRecordin if (timersEntry->IsRecording() && !timersEntry->IsTimerRule() && timersEntry->m_iClientId == recording.ClientID() && - timersEntry->m_iClientChannelUid == recording.ChannelUid() && - timersEntry->StartAsUTC() <= recording.RecordingTimeAsUTC() && - timersEntry->EndAsUTC() >= recording.EndTimeAsUTC()) + timersEntry->m_iClientChannelUid == recording.ChannelUid()) { - return timersEntry; + // first, match epg event uids, if available + if (timersEntry->UniqueBroadcastID() == recording.BroadcastUid() && + timersEntry->UniqueBroadcastID() != EPG_TAG_INVALID_UID) + return timersEntry; + + // alternatively, match start and end times + const CDateTime timerStart = timersEntry->StartAsUTC() - CDateTimeSpan(0, 0, timersEntry->m_iMarginStart, 0); + const CDateTime timerEnd = timersEntry->EndAsUTC() + CDateTimeSpan(0, 0, timersEntry->m_iMarginEnd, 0); + if (timerStart <= recording.RecordingTimeAsUTC() && + timerEnd >= recording.EndTimeAsUTC()) + return timersEntry; } } } |