summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2011-09-11 14:49:33 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2011-09-11 14:49:33 +0200
commit7d637b588f1d6be5972591dc788a54bd9ba8ee5c (patch)
treea83e1e75b3f6616040e7e7ae717b5ec5035058c2
parent56bdd34c07c91fb0815b3bebf0719c6209fe73b3 (diff)
downloadvdr-7d637b588f1d6be5972591dc788a54bd9ba8ee5c.tar.gz
vdr-7d637b588f1d6be5972591dc788a54bd9ba8ee5c.tar.bz2
The SVDRP command LSTC now also accepts channel IDs
-rw-r--r--CONTRIBUTORS3
-rw-r--r--HISTORY1
-rw-r--r--svdrp.c26
3 files changed, 18 insertions, 12 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 5e10a042..f49c0ab0 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -2778,3 +2778,6 @@ Frank Niederwipper <f.niederwipper@gmail.com>
Chris Mayo <aklhfex@gmail.com>
for reporting a problem with detecting frames on radio channels
+
+Dominic Evans <oldmanuk@gmail.com>
+ for making the SVDRP command LSTC accepts channel IDs
diff --git a/HISTORY b/HISTORY
index 92609911..3831a4b8 100644
--- a/HISTORY
+++ b/HISTORY
@@ -6756,3 +6756,4 @@ Video Disk Recorder Revision History
- The 'U' parameter in the diseqc.conf file has been changed to 'S' ("Scr").
- The configuration file name has been changed from "unicable.conf" to "scr.conf".
- Updated sources.conf (thanks to Arthur Konovalov).
+- The SVDRP command LSTC now also accepts channel IDs (thanks to Dominic Evans).
diff --git a/svdrp.c b/svdrp.c
index e8e75b39..bdd8cc84 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 2.10 2011/08/27 10:43:18 kls Exp $
+ * $Id: svdrp.c 2.11 2011/09/11 14:47:22 kls Exp $
*/
#include "svdrp.h"
@@ -224,7 +224,7 @@ const char *HelpPages[] = {
" valid key names is given. If more than one key is given, they are\n"
" entered into the remote control queue in the given sequence. There\n"
" can be up to 31 keys.",
- "LSTC [ :groups | <number> | <name> ]\n"
+ "LSTC [ :groups | <number> | <name> | <id> ]\n"
" List channels. Without option, all channels are listed. Otherwise\n"
" only the given channel is listed. If a name is given, all channels\n"
" containing the given string as part of their name are listed.\n"
@@ -948,16 +948,18 @@ void cSVDRP::CmdLSTC(const char *Option)
Reply(501, "Channel \"%s\" not defined", Option);
}
else {
- cChannel *next = NULL;
- for (cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
- if (!channel->GroupSep()) {
- if (strcasestr(channel->Name(), Option)) {
- if (next)
- Reply(-250, "%d %s", next->Number(), *next->ToText());
- next = channel;
- }
- }
- }
+ cChannel *next = Channels.GetByChannelID(tChannelID::FromString(Option));
+ if (!next) {
+ for (cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
+ if (!channel->GroupSep()) {
+ if (strcasestr(channel->Name(), Option)) {
+ if (next)
+ Reply(-250, "%d %s", next->Number(), *next->ToText());
+ next = channel;
+ }
+ }
+ }
+ }
if (next)
Reply(250, "%d %s", next->Number(), *next->ToText());
else