summaryrefslogtreecommitdiff
path: root/svdrp.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2018-02-28 10:06:47 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2018-02-28 10:06:47 +0100
commit9c3ce0048a4572e602dc9f23c36940993db4959b (patch)
tree89eaa553944ce36acae3b125de15340bb269dd87 /svdrp.c
parent3a3a2339947cb9ca9b319e180e0521079be8551d (diff)
downloadvdr-9c3ce0048a4572e602dc9f23c36940993db4959b.tar.gz
vdr-9c3ce0048a4572e602dc9f23c36940993db4959b.tar.bz2
When remote timers are fetched from a peer VDR, we no longer blindly delete and re-add them, but rather compare them and make only the minimum necessary changes
Diffstat (limited to 'svdrp.c')
-rw-r--r--svdrp.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/svdrp.c b/svdrp.c
index 6e3a58a2..93ead5eb 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.30 2018/02/26 15:42:15 kls Exp $
+ * $Id: svdrp.c 4.31 2018/02/28 10:04:00 kls Exp $
*/
#include "svdrp.h"
@@ -483,8 +483,23 @@ bool cSVDRPClient::HasFetchFlag(eSvdrpFetchFlags Flag)
bool cSVDRPClient::GetRemoteTimers(cStringList &Response)
{
- if (HasFetchFlag(sffTimers))
- return Execute("LSTT ID", &Response);
+ if (HasFetchFlag(sffTimers)) {
+ if (Execute("LSTT ID", &Response)) {
+ for (int i = 0; i < Response.Size(); i++) {
+ char *s = Response[i];
+ int Code = SVDRPCode(s);
+ if (Code == 250)
+ strshift(s, 4);
+ else {
+ if (Code != 550)
+ esyslog("ERROR: %s: %s", ServerName(), s);
+ return false;
+ }
+ }
+ Response.SortNumerically();
+ return true;
+ }
+ }
return false;
}