1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

The SVDRP command DELC now also accepts a channel id

This commit is contained in:
Klaus Schmidinger 2020-05-05 15:37:49 +02:00
parent abe61dc903
commit c813de133b
3 changed files with 43 additions and 40 deletions

View File

@ -2918,6 +2918,7 @@ Manuel Reimer <Manuel.Reimer@gmx.de>
when switching to a less privileged user id when switching to a less privileged user id
for reporting a bug in moving channels between number groups in SVDRP's MOVC command for reporting a bug in moving channels between number groups in SVDRP's MOVC command
for fixing compatibility with current versions of glibc for fixing compatibility with current versions of glibc
for suggesting to make the SVDRP command DELC accept a channel id
Rene van den Braken <rene@vandenbraken.name> Rene van den Braken <rene@vandenbraken.name>
for reporting a bug in writing the PCR pid into the PMT in for reporting a bug in writing the PCR pid into the PMT in

View File

@ -9420,7 +9420,7 @@ Video Disk Recorder Revision History
- Fixed handling the S2SatelliteDeliverySystemDescriptor for transponders broadcasting - Fixed handling the S2SatelliteDeliverySystemDescriptor for transponders broadcasting
in "backwards compatibility mode" according to ETSI EN 300 468 (thanks to Onur Sentürk). in "backwards compatibility mode" according to ETSI EN 300 468 (thanks to Onur Sentürk).
2020-05-04: 2020-05-05:
- Fixed moving channels between number groups in SVDRP's MOVC command and the Channels - Fixed moving channels between number groups in SVDRP's MOVC command and the Channels
menu, in case a channel is moved to a higher number and into a numbered group menu, in case a channel is moved to a higher number and into a numbered group
@ -9429,3 +9429,4 @@ Video Disk Recorder Revision History
for NID and TID (thanks to Uwe Scheffler for reporting a problem with failed tuning for NID and TID (thanks to Uwe Scheffler for reporting a problem with failed tuning
in SCR systems, and Helmut Binder for helping with the implementation). in SCR systems, and Helmut Binder for helping with the implementation).
- Fixed compatibility with current versions of glibc (thanks to Manuel Reimer). - Fixed compatibility with current versions of glibc (thanks to Manuel Reimer).
- The SVDRP command DELC now also accepts a channel id (suggested by Manuel Reimer).

19
svdrp.c
View File

@ -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 4.40 2020/04/11 09:22:05 kls Exp $ * $Id: svdrp.c 4.41 2020/05/05 15:37:49 kls Exp $
*/ */
#include "svdrp.h" #include "svdrp.h"
@ -840,8 +840,8 @@ const char *HelpPages[] = {
" Used by peer-to-peer connections between VDRs to tell the other VDR\n" " Used by peer-to-peer connections between VDRs to tell the other VDR\n"
" to establish a connection to this VDR. The name is the SVDRP host name\n" " to establish a connection to this VDR. The name is the SVDRP host name\n"
" of this VDR, which may differ from its DNS name.", " of this VDR, which may differ from its DNS name.",
"DELC <number>\n" "DELC <number> | <id>\n"
" Delete channel.", " Delete the channel with the given number or channel id.",
"DELR <id>\n" "DELR <id>\n"
" Delete the recording with the given id. Before a recording can be\n" " Delete the recording with the given id. Before a recording can be\n"
" deleted, an LSTR command should have been executed in order to retrieve\n" " deleted, an LSTR command should have been executed in order to retrieve\n"
@ -1379,11 +1379,15 @@ void cSVDRPServer::CmdCONN(const char *Option)
void cSVDRPServer::CmdDELC(const char *Option) void cSVDRPServer::CmdDELC(const char *Option)
{ {
if (*Option) { if (*Option) {
if (isnumber(Option)) {
LOCK_TIMERS_READ; LOCK_TIMERS_READ;
LOCK_CHANNELS_WRITE; LOCK_CHANNELS_WRITE;
Channels->SetExplicitModify(); Channels->SetExplicitModify();
if (cChannel *Channel = Channels->GetByNumber(strtol(Option, NULL, 10))) { cChannel *Channel = NULL;
if (isnumber(Option))
Channel = Channels->GetByNumber(strtol(Option, NULL, 10));
else
Channel = Channels->GetByChannelID(tChannelID::FromString(Option));
if (Channel) {
if (const cTimer *Timer = Timers->UsesChannel(Channel)) { if (const cTimer *Timer = Timers->UsesChannel(Channel)) {
Reply(550, "Channel \"%s\" is in use by timer %s", Option, *Timer->ToDescr()); Reply(550, "Channel \"%s\" is in use by timer %s", Option, *Timer->ToDescr());
return; return;
@ -1418,10 +1422,7 @@ void cSVDRPServer::CmdDELC(const char *Option)
Reply(501, "Channel \"%s\" not defined", Option); Reply(501, "Channel \"%s\" not defined", Option);
} }
else else
Reply(501, "Error in channel number \"%s\"", Option); Reply(501, "Missing channel number or id");
}
else
Reply(501, "Missing channel number");
} }
static cString RecordingInUseMessage(int Reason, const char *RecordingId, cRecording *Recording) static cString RecordingInUseMessage(int Reason, const char *RecordingId, cRecording *Recording)