mirror of
https://projects.vdr-developer.org/git/vdr-plugin-streamdev.git
synced 2023-10-10 19:16:51 +02:00
added DELT FORCE option to delete running timers (#554)
This commit is contained in:
parent
913e6164b6
commit
25f287f5b1
@ -113,6 +113,7 @@ Artem Makhutov
|
|||||||
|
|
||||||
Alwin Esch
|
Alwin Esch
|
||||||
for adding XBMC support by extending VTP capabilities
|
for adding XBMC support by extending VTP capabilities
|
||||||
|
for adding the DELT FORCE option to delete running timers
|
||||||
|
|
||||||
BBlack
|
BBlack
|
||||||
for reporting that updating recordings list on CmdPLAY is a bad idea
|
for reporting that updating recordings list on CmdPLAY is a bad idea
|
||||||
|
1
HISTORY
1
HISTORY
@ -1,6 +1,7 @@
|
|||||||
VDR Plugin 'streamdev' Revision History
|
VDR Plugin 'streamdev' Revision History
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
|
- added DELT FORCE option to delete running timers (thanks to Alwin Esch)
|
||||||
- fixed missing virtual destructor for cTSRemux
|
- fixed missing virtual destructor for cTSRemux
|
||||||
- improved PARENTALRATING patch detection was missing in this branch
|
- improved PARENTALRATING patch detection was missing in this branch
|
||||||
- silenced warnings concerning asprintf (requested by Rolf Ahrenberg)
|
- silenced warnings concerning asprintf (requested by Rolf Ahrenberg)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: connectionVTP.c,v 1.18.2.5 2009/10/13 06:48:23 schmirl Exp $
|
* $Id: connectionVTP.c,v 1.18.2.6 2010/01/29 12:02:44 schmirl Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "server/connectionVTP.h"
|
#include "server/connectionVTP.h"
|
||||||
@ -1390,22 +1390,52 @@ bool cConnectionVTP::CmdDELT(const char *Option)
|
|||||||
{
|
{
|
||||||
INIT_WRAPPER();
|
INIT_WRAPPER();
|
||||||
if (*Option) {
|
if (*Option) {
|
||||||
if (isnumber(Option)) {
|
int number = 0;
|
||||||
cTimer *timer = Timers.Get(strtol(Option, NULL, 10) - 1);
|
bool force = false;
|
||||||
|
char buf[strlen(Option) + 1];
|
||||||
|
strcpy(buf, Option);
|
||||||
|
const char *delim = " \t";
|
||||||
|
char *strtok_next;
|
||||||
|
char *p = strtok_r(buf, delim, &strtok_next);
|
||||||
|
|
||||||
|
if (isnumber(p)) {
|
||||||
|
number = strtol(p, NULL, 10) - 1;
|
||||||
|
}
|
||||||
|
else if (strcasecmp(p, "FORCE") == 0) {
|
||||||
|
force = true;
|
||||||
|
}
|
||||||
|
if ((p = strtok_r(NULL, delim, &strtok_next)) != NULL) {
|
||||||
|
if (isnumber(p)) {
|
||||||
|
number = strtol(p, NULL, 10) - 1;
|
||||||
|
}
|
||||||
|
else if (strcasecmp(p, "FORCE") == 0) {
|
||||||
|
force = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Reply(501, "Timer not found or wrong syntax");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cTimer *timer = Timers.Get(number);
|
||||||
if (timer) {
|
if (timer) {
|
||||||
if (!timer->Recording()) {
|
if (timer->Recording()) {
|
||||||
|
if (force) {
|
||||||
|
timer->Skip();
|
||||||
|
cRecordControls::Process(time(NULL));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Reply(550, "Timer \"%i\" is recording", number);
|
||||||
|
EXIT_WRAPPER();
|
||||||
|
}
|
||||||
|
}
|
||||||
isyslog("deleting timer %s", *timer->ToDescr());
|
isyslog("deleting timer %s", *timer->ToDescr());
|
||||||
Timers.Del(timer);
|
Timers.Del(timer);
|
||||||
Timers.SetModified();
|
Timers.SetModified();
|
||||||
Reply(250, "Timer \"%s\" deleted", Option);
|
Reply(250, "Timer \"%i\" deleted", number);
|
||||||
} else
|
} else
|
||||||
Reply(550, "Timer \"%s\" is recording", Option);
|
Reply(501, "Timer \"%i\" not defined", number);
|
||||||
} else
|
} else
|
||||||
Reply(501, "Timer \"%s\" not defined", Option);
|
Reply(501, "Missing timer option");
|
||||||
} else
|
|
||||||
Reply(501, "Error in timer number \"%s\"", Option);
|
|
||||||
} else
|
|
||||||
Reply(501, "Missing timer number");
|
|
||||||
EXIT_WRAPPER();
|
EXIT_WRAPPER();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user