[vdr] NEWT checks for similiar timers, MODT does not

Klaus Schmidinger Klaus.Schmidinger at tvdr.de
Fri Dec 14 10:23:11 CET 2012


On 13.12.2012 23:19, Malte Forkel wrote:
> Hi,
>
> I noticed the following when using SVDRP: With the command NEWT, you
> can't create a timer if there already exists a timer for the same
> channel, day, start time and stop time. But you can create some dummy
> timer and then use the MODT command to make it identical to the existing
> timer. Here is a sample session:
>
> malte at spiro:~$ telnet louie 6419
> Trying 10.0.1.208...
> Connected to louie.forkel.lan.
> Escape character is '^]'.
> 220 louie SVDRP VideoDiskRecorder 1.7.28; Thu Dec 13 20:48:34 2012; UTF-8
> newt 1:148:2012-12-14:1800:1900:50:99:first:
> 250 1 1:148:2012-12-14:1800:1900:50:99:first:
> newt 1:148:2012-12-14:1800:1900:50:99:second:
> 550 timer already defined: 1 1:148:2012-12-14:1800:1900:50:99:first:
> lstt
> 250 1 1:148:2012-12-14:1800:1900:50:99:first:
> newt 1:148:2012-12-14:1800:1859:50:99:second:
> 250 2 1:148:2012-12-14:1800:1859:50:99:second:
> lstt
> 250-1 1:148:2012-12-14:1800:1900:50:99:first:
> 250 2 1:148:2012-12-14:1800:1859:50:99:second:
> modt 2 1:148:2012-12-14:1800:1900:50:99:second:
> 250 2 1:148:2012-12-14:1800:1900:50:99:second:
> lstt
> 250-1 1:148:2012-12-14:1800:1900:50:99:first:
> 250 2 1:148:2012-12-14:1800:1900:50:99:second:
> 221 louie closing connection
> Connection closed by foreign host.
>
> Looking at svdrp.c and timers.c, cSVDRP::CmdNEWT will use
> cTimers::GetTimer to look for an existing timer, cSVDRP::CmdMODT does
> not seem to perform a check.
>
> I'm not sure about the rationale. What would I break if I dropped the
> test in cSVDRP::CmdNEWT? Are there better workarounds than creating a
> dummy timer?

NEWT performs a simple test to prevent the user from inadvertently
creating duplicate timers. With MODT things are somewhat more complex,
because the timer is already in the list, so it would have to check
whether there is an *other* timer with the same settings. Sure, this
could also be done, but then again just let's keep things simple...

Klaus



More information about the vdr mailing list