summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Engel <dengel@mythtv.org>2011-02-27 21:06:22 (GMT)
committer David Engel <dengel@mythtv.org>2011-02-27 21:06:22 (GMT)
commit38f8fb1f2b38ba481cf7299ce2f56fe7297e5838 (patch)
tree1689e4f0023b3fae930bd7c8b518f525b73ca336
parent739a807bf4c81874b4e9bef525e0dfbf91949c07 (diff)
Slightly improve handling of failed recordings.
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.
-rw-r--r--mythtv/libs/libmythtv/tv_rec.cpp4
-rw-r--r--mythtv/programs/mythbackend/mainserver.cpp18
2 files changed, 15 insertions, 7 deletions
diff --git a/mythtv/libs/libmythtv/tv_rec.cpp b/mythtv/libs/libmythtv/tv_rec.cpp
index 7a1ff76..0195088 100644
--- a/mythtv/libs/libmythtv/tv_rec.cpp
+++ b/mythtv/libs/libmythtv/tv_rec.cpp
@@ -870,8 +870,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)
diff --git a/mythtv/programs/mythbackend/mainserver.cpp b/mythtv/programs/mythbackend/mainserver.cpp
index f89975b..5503d27 100644
--- a/mythtv/programs/mythbackend/mainserver.cpp
+++ b/mythtv/programs/mythbackend/mainserver.cpp
@@ -2267,6 +2267,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());
@@ -2278,7 +2283,6 @@ void MainServer::DoHandleStopRecording(
if (num > 0)
{
(*encoderList)[num]->StopRecording();
- recinfo.SetRecordingStatus(rsRecorded);
if (m_sched)
m_sched->UpdateRecStatus(&recinfo);
}
@@ -2297,7 +2301,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);
}
@@ -2325,7 +2328,6 @@ void MainServer::DoHandleStopRecording(
if (ismaster)
{
- recinfo.SetRecordingStatus(rsRecorded);
if (m_sched)
m_sched->UpdateRecStatus(&recinfo);
}
@@ -2408,7 +2410,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();
@@ -2417,6 +2420,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())
@@ -2430,7 +2438,6 @@ void MainServer::DoHandleDeleteRecording(
if (num > 0)
{
(*encoderList)[num]->StopRecording();
- recinfo.SetRecordingStatus(rsRecorded);
if (m_sched)
m_sched->UpdateRecStatus(&recinfo);
}
@@ -2471,7 +2478,6 @@ void MainServer::DoHandleDeleteRecording(
if (ismaster)
{
- recinfo.SetRecordingStatus(rsRecorded);
if (m_sched)
m_sched->UpdateRecStatus(&recinfo);
}