[mythtv-users] PDA Transcode: new install feature for pdatranscode.pl

Peter Watkins peterw at tux.org
Mon Dec 11 23:44:41 UTC 2006


Folks,

I've just uploaded a new version of my "pdatranscode.pl" script that now
includes code for handling the MySQL updates needed to set up a User Job.
Setting up pdatranscode.pl to run as a User Job now can be as easy as running
  pdatranscode.pl --install-job-number 1

I've updated the wiki with more info
  http://www.mythtv.org/wiki/index.php/Transcoding_for_the_PDA
and the script, as usual, is here:
  http://www.tux.org/~peterw/linux/pdatranscode.pl.txt

I'd appreciate any pointers for my mysqlQuote() function -- I deliberately chose
to write my own instead of relying on DBI in order to reduce external dependencies,
and I would not be surprised if there's something wrong with my logic.

-Peter

Sample "install" usage:

# pdatranscode --install-job-number 1  --install-job-name "PDA Transcode (normal)"

will install as UserJob number 1, "PDA Transcode (normal)" the following command:
  /usr/local/bin/pdatranscode --file %FILE% --title "%TITLE%" --subtitle "%SUBTITLE%" --description "%DESCRIPTION%"

by issuing the following SQL query to "/usr/bin/mysql -h 127.0.0.1 -u mythtv -p >/tmp/pdatranscode-install-5286795/mysql.out":
  use mythconverg;
  # First, we retrieve what's currently in the database,
  # just in case something goes awry.
  SELECT * FROM settings WHERE value='UserJob1';
  SELECT * FROM settings WHERE value='UserJobDesc1';
  SELECT * FROM settings WHERE value='JobAllowUserJob1';
  UPDATE settings SET data='/usr/local/bin/pdatranscode --file %FILE% --title "%TITLE%" --subtitle "%SUBTITLE%" --description
"%DESCRIPTION%"' WHERE value='UserJob1';
  UPDATE settings SET data='PDA Transcode (normal)' WHERE value='UserJobDesc1';
  UPDATE settings SET data='1' WHERE value='JobAllowUserJob1';
  # Now see what's in the database after the UPDATE statements
  SELECT * FROM settings WHERE value='UserJob1';
  SELECT * FROM settings WHERE value='UserJobDesc1';
  SELECT * FROM settings WHERE value='JobAllowUserJob1';

Interrupt (press Control-C) to abort, or press Return to continue.
Enter password:
It appears that the database update was successful.
See /tmp/pdatranscode-install-5286795/mysql.out for MySQL output.

Please note: you likely need to restart mythbackend to effect any changes.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: OpenPGP digital signature
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20061211/a7dbd13e/attachment.pgp 


More information about the mythtv-users mailing list