diff --git a/xbmc/pvr/recordings/PVRRecording.cpp b/xbmc/pvr/recordings/PVRRecording.cpp index f6f44b91fe148..e516212c2a32a 100644 --- a/xbmc/pvr/recordings/PVRRecording.cpp +++ b/xbmc/pvr/recordings/PVRRecording.cpp @@ -200,10 +200,17 @@ bool CPVRRecording::Delete(void) DisplayError(error); return false; } - + OnDelete(); return true; } +void CPVRRecording::OnDelete(void) +{ + EPG::CEpgInfoTagPtr epgTag = EPG::CEpgContainer::Get().GetTagById(EpgEvent()); + if (epgTag) + epgTag->ClearRecording(); +} + bool CPVRRecording::Undelete(void) { PVR_ERROR error = g_PVRClients->UndeleteRecording(*this); @@ -363,6 +370,10 @@ void CPVRRecording::Update(const CPVRRecording &tag) strEpisode.erase(0, pos + 2); m_strPlotOutline = strEpisode; } + + if (m_bIsDeleted) + OnDelete(); + UpdatePath(); } diff --git a/xbmc/pvr/recordings/PVRRecording.h b/xbmc/pvr/recordings/PVRRecording.h index cc94d4de9df98..eefdd23c304cc 100644 --- a/xbmc/pvr/recordings/PVRRecording.h +++ b/xbmc/pvr/recordings/PVRRecording.h @@ -120,6 +120,11 @@ namespace PVR */ bool Delete(void); + /*! + * @brief Called when this recording has been deleted + */ + void OnDelete(void); + /*! * @brief Undelete this recording on the client (if supported). * @return True if it was undeleted successfully, false otherwise. diff --git a/xbmc/pvr/recordings/PVRRecordings.cpp b/xbmc/pvr/recordings/PVRRecordings.cpp index 93bc5a03312d4..4c10bf78d2852 100644 --- a/xbmc/pvr/recordings/PVRRecordings.cpp +++ b/xbmc/pvr/recordings/PVRRecordings.cpp @@ -523,7 +523,7 @@ void CPVRRecordings::UpdateEpgTags(void) for (PVR_RECORDINGMAP_ITR it = m_recordings.begin(); it != m_recordings.end(); ++it) { iEpgEvent = it->second->EpgEvent(); - if (iEpgEvent > 0) + if (iEpgEvent > 0 && !it->second->IsDeleted()) { EPG::CEpgInfoTagPtr epgTag = EPG::CEpgContainer::Get().GetTagById(iEpgEvent); if (epgTag)