From 58d7780f66f2b5ee7d91e99f90ef73fb93691eef Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Sun, 17 Jan 2010 15:28:09 +0100 Subject: check of recordings length in test of complete recordings active --- recstatus.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'recstatus.c') diff --git a/recstatus.c b/recstatus.c index 0a3f977..fe5a0fd 100644 --- a/recstatus.c +++ b/recstatus.c @@ -130,19 +130,24 @@ void cRecStatusMonitor::Recording(const cDevice *Device, const char *Name, const bool complete = true; cRecording *pRecording = Recordings.GetByName(Filename); long timerLengthMins = (tiR->timer->StopTime()-tiR->timer->StartTime())/60; + int recFraction = 100; if (pRecording && timerLengthMins) { int recLen = RecLengthInMins(pRecording); - LogFile.Log(2,"recorded %ld of %ld minutes %.0f", recLen, timerLengthMins, recLen * 100 / timerLengthMins); + recFraction = double(recLen) * 100 / timerLengthMins; } - if (now < tiR->timer->StopTime()) + if (now < tiR->timer->StopTime() || recFraction < 98) // assure timer has reached its end or at least 98% were recorded { complete = false; - LogFile.Log(1,"finished: '%s' (not complete!); search timer: '%s'", tiR->timer->File(), search->search); + LogFile.Log(1,"finished: '%s' (not complete! - recorded only %d%%); search timer: '%s'", tiR->timer->File(), recFraction, search->search); } else + { LogFile.Log(1,"finished: '%s'; search timer: '%s'", tiR->timer->File(), search->search); + if (recFraction < 100) + LogFile.Log(2,"recorded %d%%'", recFraction); + } if (complete) { RecsDone.Add(tiR->recDone); -- cgit v1.2.3