summaryrefslogtreecommitdiff
path: root/svdrp.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2018-04-19 09:45:08 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2018-04-19 09:45:08 +0200
commitd84ec07ff67f259c17462f7aa7a5c489e5f05713 (patch)
tree81c399da4e1e423446afccd5ca69dc8eeaa7998b /svdrp.c
parentc48d5242cea48a74c263fdef4005f248f92ee6e1 (diff)
downloadvdr-d84ec07ff67f259c17462f7aa7a5c489e5f05713.tar.gz
vdr-d84ec07ff67f259c17462f7aa7a5c489e5f05713.tar.bz2
Fixed handling the tfRecording flag in the SVDRP commands MODT and UPDT
Diffstat (limited to 'svdrp.c')
-rw-r--r--svdrp.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/svdrp.c b/svdrp.c
index 0f56d10f..823f23e1 100644
--- a/svdrp.c
+++ b/svdrp.c
@@ -10,7 +10,7 @@
* and interact with the Video Disk Recorder - or write a full featured
* graphical interface that sits on top of an SVDRP connection.
*
- * $Id: svdrp.c 4.37 2018/03/19 12:16:33 kls Exp $
+ * $Id: svdrp.c 4.38 2018/04/19 09:45:08 kls Exp $
*/
#include "svdrp.h"
@@ -2036,6 +2036,7 @@ void cSVDRPServer::CmdMODT(const char *Option)
LOCK_TIMERS_WRITE;
Timers->SetExplicitModify();
if (cTimer *Timer = Timers->GetById(Id)) {
+ bool IsRecording = Timer->HasFlags(tfRecording);
cTimer t = *Timer;
if (strcasecmp(tail, "ON") == 0)
t.SetFlags(tfActive);
@@ -2046,6 +2047,10 @@ void cSVDRPServer::CmdMODT(const char *Option)
return;
}
*Timer = t;
+ if (IsRecording)
+ Timer->SetFlags(tfRecording);
+ else
+ Timer->ClrFlags(tfRecording);
Timers->SetModified();
isyslog("SVDRP %s < %s modified timer %s (%s)", Setup.SVDRPHostName, *clientName, *Timer->ToDescr(), Timer->HasFlags(tfActive) ? "active" : "inactive");
Reply(250, "%d %s", Timer->Id(), *Timer->ToText(true));
@@ -2478,12 +2483,18 @@ void cSVDRPServer::CmdUPDT(const char *Option)
if (Timer->Parse(Option)) {
LOCK_TIMERS_WRITE;
if (cTimer *t = Timers->GetTimer(Timer)) {
+ bool IsRecording = t->HasFlags(tfRecording);
t->Parse(Option);
delete Timer;
Timer = t;
+ if (IsRecording)
+ Timer->SetFlags(tfRecording);
+ else
+ Timer->ClrFlags(tfRecording);
isyslog("SVDRP %s < %s updated timer %s", Setup.SVDRPHostName, *clientName, *Timer->ToDescr());
}
else {
+ Timer->ClrFlags(tfRecording);
Timers->Add(Timer);
isyslog("SVDRP %s < %s added timer %s", Setup.SVDRPHostName, *clientName, *Timer->ToDescr());
}