1b915af
# This patch fixes a bug in handling the tfRecording flag in the SVDRP commands MODT
1b915af
# and UPDT. The tfRecording flag must only be handled by the VDR that actually hosts
1b915af
# and processes the timer.
1b915af
#
1b915af
--- svdrp.c	2018/03/19 12:16:33	5.0
1b915af
+++ svdrp.c	2018/04/19 09:45:08
1b915af
@@ -2036,6 +2036,7 @@
1b915af
         LOCK_TIMERS_WRITE;
1b915af
         Timers->SetExplicitModify();
1b915af
         if (cTimer *Timer = Timers->GetById(Id)) {
1b915af
+           bool IsRecording = Timer->HasFlags(tfRecording);
1b915af
            cTimer t = *Timer;
1b915af
            if (strcasecmp(tail, "ON") == 0)
1b915af
               t.SetFlags(tfActive);
1b915af
@@ -2046,6 +2047,10 @@
1b915af
               return;
1b915af
               }
1b915af
            *Timer = t;
1b915af
+           if (IsRecording)
1b915af
+              Timer->SetFlags(tfRecording);
1b915af
+           else
1b915af
+              Timer->ClrFlags(tfRecording);
1b915af
            Timers->SetModified();
1b915af
            isyslog("SVDRP %s < %s modified timer %s (%s)", Setup.SVDRPHostName, *clientName, *Timer->ToDescr(), Timer->HasFlags(tfActive) ? "active" : "inactive");
1b915af
            Reply(250, "%d %s", Timer->Id(), *Timer->ToText(true));
1b915af
@@ -2478,12 +2483,18 @@
1b915af
      if (Timer->Parse(Option)) {
1b915af
         LOCK_TIMERS_WRITE;
1b915af
         if (cTimer *t = Timers->GetTimer(Timer)) {
1b915af
+           bool IsRecording = t->HasFlags(tfRecording);
1b915af
            t->Parse(Option);
1b915af
            delete Timer;
1b915af
            Timer = t;
1b915af
+           if (IsRecording)
1b915af
+              Timer->SetFlags(tfRecording);
1b915af
+           else
1b915af
+              Timer->ClrFlags(tfRecording);
1b915af
            isyslog("SVDRP %s < %s updated timer %s", Setup.SVDRPHostName, *clientName, *Timer->ToDescr());
1b915af
            }
1b915af
         else {
1b915af
+           Timer->ClrFlags(tfRecording);
1b915af
            Timers->Add(Timer);
1b915af
            isyslog("SVDRP %s < %s added timer %s", Setup.SVDRPHostName, *clientName, *Timer->ToDescr());
1b915af
            }