Fixed unexpected calls of the '-r' script when a recording is interrupted and the timer has not yet finished

This commit is contained in:
Klaus Schmidinger 2022-03-03 14:44:47 +01:00
parent d3f3e856e4
commit a843d03af1
2 changed files with 6 additions and 4 deletions

View File

@ -9780,6 +9780,8 @@ Video Disk Recorder Revision History
out by Onur Sentürk).
- Official release.
2022-02-09:
2022-03-03:
- Added UPDATE-2.6.0, which was missing in the official 2.6.0 release.
- Fixed unexpected calls of the '-r' script when a recording is interrupted and
the timer has not yet finished.

6
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.c 5.6 2021/05/21 10:41:31 kls Exp $
* $Id: menu.c 5.7 2022/03/03 14:44:47 kls Exp $
*/
#include "menu.h"
@ -5418,9 +5418,9 @@ bool cRecordControl::GetEvent(void)
void cRecordControl::Stop(bool ExecuteUserCommand)
{
if (timer) {
bool Finished = timer->HasFlags(tfActive) && !timer->Matches();
if (recorder) {
int Errors = recorder->Errors();
bool Finished = timer->HasFlags(tfActive) && !timer->Matches();
isyslog("timer %s %s with %d error%s", *timer->ToDescr(), Finished ? "finished" : "stopped", Errors, Errors != 1 ? "s" : "");
if (timer->HasFlags(tfAvoid) && Errors == 0 && Finished) {
const char *p = strgetlast(timer->File(), FOLDERDELIMCHAR);
@ -5432,7 +5432,7 @@ void cRecordControl::Stop(bool ExecuteUserCommand)
timer = NULL;
SetRecordingTimerId(fileName, NULL);
cStatus::MsgRecording(device, NULL, fileName, false);
if (ExecuteUserCommand)
if (ExecuteUserCommand && Finished)
cRecordingUserCommand::InvokeCommand(RUC_AFTERRECORDING, fileName);
}
}