diff --git a/xbmc/pvr/recordings/PVRRecording.cpp b/xbmc/pvr/recordings/PVRRecording.cpp index e516212c2a32a..c34604a4b5f19 100644 --- a/xbmc/pvr/recordings/PVRRecording.cpp +++ b/xbmc/pvr/recordings/PVRRecording.cpp @@ -441,3 +441,13 @@ CPVRChannelPtr CPVRRecording::Channel(void) const } return CPVRChannelPtr(); } + +bool CPVRRecording::IsBeingRecorded(void) const +{ + if (m_iEpgEventId) + { + EPG::CEpgInfoTagPtr epgTag = EPG::CEpgContainer::Get().GetTagById(m_iEpgEventId); + return epgTag ? epgTag->HasRecording() : false; + } + return false; +} diff --git a/xbmc/pvr/recordings/PVRRecording.h b/xbmc/pvr/recordings/PVRRecording.h index eefdd23c304cc..d65c4a1512dbc 100644 --- a/xbmc/pvr/recordings/PVRRecording.h +++ b/xbmc/pvr/recordings/PVRRecording.h @@ -212,9 +212,16 @@ namespace PVR /*! * @return Get the channel on which this recording is/was running + * @note Only works if the recording has an EPG id provided by the add-on */ CPVRChannelPtr Channel(void) const; + /*! + * @return True while the recording is running + * @note Only works if the recording has an EPG id provided by the add-on + */ + bool IsBeingRecorded(void) const; + private: CDateTime m_recordingTime; /*!< start time of the recording */ bool m_bGotMetaData;