mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Improved performance of the SVDRP commands LSTC and CHAN when used with a channel name
This commit is contained in:
parent
24232a0010
commit
d66eba77c2
2
HISTORY
2
HISTORY
@ -5271,3 +5271,5 @@ Video Disk Recorder Revision History
|
|||||||
to Andreas Mair).
|
to Andreas Mair).
|
||||||
- Added full weekday names to i18n.c for plugins to use (thanks to Patrice Staudt).
|
- Added full weekday names to i18n.c for plugins to use (thanks to Patrice Staudt).
|
||||||
- Fixed stripping i18n stuff from font names (reported by Anssi Hannula).
|
- Fixed stripping i18n stuff from font names (reported by Anssi Hannula).
|
||||||
|
- Improved performance of the SVDRP commands LSTC and CHAN when used with a
|
||||||
|
channel name.
|
||||||
|
56
svdrp.c
56
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.101 2007/04/30 12:41:07 kls Exp $
|
* $Id: svdrp.c 1.102 2007/06/23 13:14:59 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "svdrp.h"
|
#include "svdrp.h"
|
||||||
@ -497,14 +497,14 @@ void cSVDRP::CmdCHAN(const char *Option)
|
|||||||
if (channel)
|
if (channel)
|
||||||
n = channel->Number();
|
n = channel->Number();
|
||||||
else {
|
else {
|
||||||
int i = 1;
|
for (cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
|
||||||
while ((channel = Channels.GetByNumber(i, 1)) != NULL) {
|
if (!channel->GroupSep()) {
|
||||||
if (strcasecmp(channel->Name(), Option) == 0) {
|
if (strcasecmp(channel->Name(), Option) == 0) {
|
||||||
n = channel->Number();
|
n = channel->Number();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i = channel->Number() + 1;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
@ -871,23 +871,16 @@ void cSVDRP::CmdLSTC(const char *Option)
|
|||||||
Reply(501, "Channel \"%s\" not defined", Option);
|
Reply(501, "Channel \"%s\" not defined", Option);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int i = 1;
|
|
||||||
cChannel *next = NULL;
|
cChannel *next = NULL;
|
||||||
while (i <= Channels.MaxNumber()) {
|
for (cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
|
||||||
cChannel *channel = Channels.GetByNumber(i, 1);
|
if (!channel->GroupSep()) {
|
||||||
if (channel) {
|
if (strcasestr(channel->Name(), Option)) {
|
||||||
if (strcasestr(channel->Name(), Option)) {
|
if (next)
|
||||||
if (next)
|
Reply(-250, "%d %s", next->Number(), *next->ToText());
|
||||||
Reply(-250, "%d %s", next->Number(), *next->ToText());
|
next = channel;
|
||||||
next = channel;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
Reply(501, "Channel \"%d\" not found", i);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
i = channel->Number() + 1;
|
|
||||||
}
|
|
||||||
if (next)
|
if (next)
|
||||||
Reply(250, "%d %s", next->Number(), *next->ToText());
|
Reply(250, "%d %s", next->Number(), *next->ToText());
|
||||||
else
|
else
|
||||||
@ -895,15 +888,10 @@ void cSVDRP::CmdLSTC(const char *Option)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Channels.MaxNumber() >= 1) {
|
else if (Channels.MaxNumber() >= 1) {
|
||||||
int i = 1;
|
for (cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
|
||||||
while (i <= Channels.MaxNumber()) {
|
if (!channel->GroupSep())
|
||||||
cChannel *channel = Channels.GetByNumber(i, 1);
|
Reply(channel->Number() < Channels.MaxNumber() ? -250 : 250, "%d %s", channel->Number(), *channel->ToText());
|
||||||
if (channel)
|
}
|
||||||
Reply(channel->Number() < Channels.MaxNumber() ? -250 : 250, "%d %s", channel->Number(), *channel->ToText());
|
|
||||||
else
|
|
||||||
Reply(501, "Channel \"%d\" not found", i);
|
|
||||||
i = channel->Number() + 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Reply(550, "No channels defined");
|
Reply(550, "No channels defined");
|
||||||
|
Loading…
Reference in New Issue
Block a user