mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
SVDRP commands LSTC and LSTT now return an error message if no channels or timers are defined
This commit is contained in:
parent
76521306b1
commit
e3c265d186
6
HISTORY
6
HISTORY
@ -413,3 +413,9 @@ Video Disk Recorder Revision History
|
|||||||
VDR exit in case the main program loop does not respond for more than the
|
VDR exit in case the main program loop does not respond for more than the
|
||||||
given number of seconds. This is mainly useful in combination with the new
|
given number of seconds. This is mainly useful in combination with the new
|
||||||
'runvdr' script that restarts VDR in case is has exited.
|
'runvdr' script that restarts VDR in case is has exited.
|
||||||
|
|
||||||
|
2001-03-02: Version 0.72
|
||||||
|
|
||||||
|
- Fixed SVDRP commands LSTC and LSTT to make them return an error message if
|
||||||
|
no channels or timers are defined.
|
||||||
|
|
||||||
|
10
svdrp.c
10
svdrp.c
@ -10,7 +10,7 @@
|
|||||||
* and interact with the Video Disk Recorder - or write a full featured
|
* and interact with the Video Disk Recorder - or write a full featured
|
||||||
* graphical interface that sits on top of an SVDRP connection.
|
* graphical interface that sits on top of an SVDRP connection.
|
||||||
*
|
*
|
||||||
* $Id: svdrp.c 1.14 2001/02/18 14:18:13 kls Exp $
|
* $Id: svdrp.c 1.15 2001/03/02 22:59:37 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
@ -535,7 +535,7 @@ void cSVDRP::CmdLSTC(const char *Option)
|
|||||||
Reply(250, "%d %s", next->number, next->ToText());
|
Reply(250, "%d %s", next->number, next->ToText());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else if (Channels.MaxNumber() >= 1) {
|
||||||
for (int i = 1; i <= Channels.MaxNumber(); i++) {
|
for (int i = 1; i <= Channels.MaxNumber(); i++) {
|
||||||
cChannel *channel = Channels.GetByNumber(i);
|
cChannel *channel = Channels.GetByNumber(i);
|
||||||
if (channel)
|
if (channel)
|
||||||
@ -544,6 +544,8 @@ void cSVDRP::CmdLSTC(const char *Option)
|
|||||||
Reply(501, "Channel \"%d\" not found", i);
|
Reply(501, "Channel \"%d\" not found", i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
Reply(550, "No channels defined");
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSVDRP::CmdLSTT(const char *Option)
|
void cSVDRP::CmdLSTT(const char *Option)
|
||||||
@ -559,7 +561,7 @@ void cSVDRP::CmdLSTT(const char *Option)
|
|||||||
else
|
else
|
||||||
Reply(501, "Error in timer number \"%s\"", Option);
|
Reply(501, "Error in timer number \"%s\"", Option);
|
||||||
}
|
}
|
||||||
else {
|
else if (Timers.Count()) {
|
||||||
for (int i = 0; i < Timers.Count(); i++) {
|
for (int i = 0; i < Timers.Count(); i++) {
|
||||||
cTimer *timer = Timers.Get(i);
|
cTimer *timer = Timers.Get(i);
|
||||||
if (timer)
|
if (timer)
|
||||||
@ -568,6 +570,8 @@ void cSVDRP::CmdLSTT(const char *Option)
|
|||||||
Reply(501, "Timer \"%d\" not found", i + 1);
|
Reply(501, "Timer \"%d\" not found", i + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
Reply(550, "No timers defined");
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSVDRP::CmdMESG(const char *Option)
|
void cSVDRP::CmdMESG(const char *Option)
|
||||||
|
Loading…
Reference in New Issue
Block a user