diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2018-02-28 10:06:47 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2018-02-28 10:06:47 +0100 |
commit | 9c3ce0048a4572e602dc9f23c36940993db4959b (patch) | |
tree | 89eaa553944ce36acae3b125de15340bb269dd87 /svdrp.c | |
parent | 3a3a2339947cb9ca9b319e180e0521079be8551d (diff) | |
download | vdr-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.c | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -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; } |