Skip to content

Commit

Permalink
[pvr] fixed: remove deleted recordings from the timeline too
Browse files Browse the repository at this point in the history
  • Loading branch information
opdenkamp committed Mar 5, 2015
1 parent 2c1a822 commit 61e0b53
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
13 changes: 12 additions & 1 deletion xbmc/pvr/recordings/PVRRecording.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -363,6 +370,10 @@ void CPVRRecording::Update(const CPVRRecording &tag)
strEpisode.erase(0, pos + 2);
m_strPlotOutline = strEpisode;
}

if (m_bIsDeleted)
OnDelete();

UpdatePath();
}

Expand Down
5 changes: 5 additions & 0 deletions xbmc/pvr/recordings/PVRRecording.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion xbmc/pvr/recordings/PVRRecordings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 61e0b53

Please sign in to comment.