[mythtv-users] Get get user job to run

Raymond Wagner raymond at wagnerrp.com
Sun Dec 11 18:51:24 UTC 2011


On 12/11/2011 13:17, Simon Hobson wrote:
> Raymond Wagner wrote:
>
>> You seem to be missing a step.  After you create the job, you have to
>> enable it on each host you want it to run.  By default, all user jobs
>> are disabled from running.  I believe that is on the page directly after
>> the job definition.
> Now all I have to do is get it working as I want. First challenge -
> getting the program title and subtitle without it breaking on quote
> characters.

A quick look at the code, that information is just being blindly 
replaced into the string with no escaping.

https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmyth/programinfo.cpp#L4248

You could quote it in your command, but if there are matching quotes in 
the title/subtitle, the shell will not split up the arguments as you 
intended before passing them into your script.  Escaping within that 
call could work, but is clumsy at best.  The ideal solution would be to 
alter the jobqueue and system event daemon to split the arguments 
internally, and call the script directly, bypassing the shell all 
together, but that's going to take a bit more work in the system class 
before that works properly.

So where does that leave you?  Well that depends on the language you're 
using.  In Perl or Python (or PHP (0.25+)), you can use the official 
bindings to pull that information from the database or backend 
protocol.  You could then key off %CHANID% and %STARTTIME%, or from 
%JOBID% directly.  Alternatively, you can pull such data from the old 
MythXML or the new Services API.




More information about the mythtv-users mailing list