Skip to content
Browse files

Slightly improve handling of failed recordings.

Backport from master to fixes/0.24.

Improve the marking of failed recordings.  This should allow future
showings to be rescheduled when possible.  Based on a patch from
dl-mythtv%40catspoiler.org.
  • Loading branch information...
1 parent 057b017 commit 6e5ca62f9bf3b1c112210521a53db7ce31ec1b78 @gigem gigem committed Feb 27, 2011
Showing with 15 additions and 7 deletions.
  1. +3 −1 mythtv/libs/libmythtv/tv_rec.cpp
  2. +12 −6 mythtv/programs/mythbackend/mainserver.cpp
View
4 mythtv/libs/libmythtv/tv_rec.cpp
@@ -874,8 +874,10 @@ void TVRec::FinishedRecording(RecordingInfo *curRec)
VERBOSE(VB_RECORD, LOC + QString("FinishedRecording(%1) in recgroup: %2")
.arg(curRec->GetTitle()).arg(recgrp));
- if (curRec->GetRecordingStatus() != rsFailed)
+ if (curRec->GetRecordingStatus() == rsRecording)
curRec->SetRecordingStatus(rsRecorded);
+ else if (curRec->GetRecordingStatus() != rsRecorded)
+ curRec->SetRecordingStatus(rsFailed);
curRec->SetRecordingEndTime(mythCurrentDateTime());
if (tvchain)
View
18 mythtv/programs/mythbackend/mainserver.cpp
@@ -2237,6 +2237,11 @@ void MainServer::DoHandleStopRecording(
if (pbs)
pbssock = pbs->getSocket();
+ if (recinfo.GetRecordingStatus() == rsRecording)
+ recinfo.SetRecordingStatus(rsRecorded);
+ else if (recinfo.GetRecordingStatus() != rsRecorded)
+ recinfo.SetRecordingStatus(rsFailed);
+
if (ismaster && recinfo.GetHostname() != gCoreContext->GetHostName())
{
PlaybackSock *slave = GetSlaveByHostname(recinfo.GetHostname());
@@ -2248,7 +2253,6 @@ void MainServer::DoHandleStopRecording(
if (num > 0)
{
(*encoderList)[num]->StopRecording();
- recinfo.SetRecordingStatus(rsRecorded);
if (m_sched)
m_sched->UpdateRecStatus(&recinfo);
}
@@ -2267,7 +2271,6 @@ void MainServer::DoHandleStopRecording(
// recording has stopped and the status should be updated.
// Continue so that the master can try to update the endtime
// of the file is in a shared directory.
- recinfo.SetRecordingStatus(rsRecorded);
if (m_sched)
m_sched->UpdateRecStatus(&recinfo);
}
@@ -2295,7 +2298,6 @@ void MainServer::DoHandleStopRecording(
if (ismaster)
{
- recinfo.SetRecordingStatus(rsRecorded);
if (m_sched)
m_sched->UpdateRecStatus(&recinfo);
}
@@ -2378,7 +2380,8 @@ void MainServer::DoHandleDeleteRecording(
{
recinfo.ApplyRecordRecGroupChange("Deleted");
recinfo.SaveAutoExpire(kDeletedAutoExpire, true);
- if (recinfo.GetRecordingStatus() == rsRecording)
+ if (recinfo.GetRecordingStatus() == rsRecording ||
+ recinfo.GetRecordingStatus() == rsTuning)
DoHandleStopRecording(recinfo, NULL);
if (forgetHistory)
recinfo.ForgetHistory();
@@ -2387,6 +2390,11 @@ void MainServer::DoHandleDeleteRecording(
return;
}
+ if (recinfo.GetRecordingStatus() == rsRecording)
+ recinfo.SetRecordingStatus(rsRecorded);
+ else if (recinfo.GetRecordingStatus() != rsRecorded)
+ recinfo.SetRecordingStatus(rsFailed);
+
// If this recording was made by a another recorder, and that
// recorder is available, tell it to do the deletion.
if (ismaster && recinfo.GetHostname() != gCoreContext->GetHostName())
@@ -2400,7 +2408,6 @@ void MainServer::DoHandleDeleteRecording(
if (num > 0)
{
(*encoderList)[num]->StopRecording();
- recinfo.SetRecordingStatus(rsRecorded);
if (m_sched)
m_sched->UpdateRecStatus(&recinfo);
}
@@ -2441,7 +2448,6 @@ void MainServer::DoHandleDeleteRecording(
if (ismaster)
{
- recinfo.SetRecordingStatus(rsRecorded);
if (m_sched)
m_sched->UpdateRecStatus(&recinfo);
}

0 comments on commit 6e5ca62

Please sign in to comment.
Something went wrong with that request. Please try again.