[mythtv-users] 0.24 Python Bindings - Transcode Wrapper Script

Robert Houghton robbadler at gmail.com
Thu Feb 17 00:51:18 UTC 2011


On Wed, Feb 16, 2011 at 10:11 AM, Raymond Wagner <raymond at wagnerrp.com>wrote:

> On 2/16/2011 12:46, Robert Houghton wrote:
> > http://www.mythtv.org/wiki/High_Quality_Transcode
>
> After looking at this script, I'm not entirely sure how it's working.
> The chanid/starttime pair in the recorded table is the primary key, and
> thus must be unique.  In your script, when inserting the new recording,
> you replace the old starttime with a new one.  However reading back
> through the code, you split apart the old starttime, and use that to
> create the same exact new time.  I don't understand why the database
> wouldn't refuse the new record every time, and cause the script to die
> at the end.
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/mailman/listinfo/mythtv-users
>

Seconds are incremented.

do {
  if ( $episodetitle eq "" || $seasonnumber eq "" || $episodenumber eq "" )
  {
    $newfilename = sprintf "%s_%s.%s.%s", $showtitle, $month, $day, $year;
  } else {
    $newfilename = sprintf "%s_S%0sE%0s_%s", $showtitle,
$seasonnumber, $episodenumber, $episodetitle;
  }
  $newfilename =~ s/\;/   AND   /g;
  $newfilename =~ s/\&/   AND   /g;
  $newfilename =~ s/\s+/ /g;
  $newfilename =~ s/\s/_/g;
  $newfilename =~ s/:/_/g;
  $newfilename =~ s/__/_/g;
  $newfilename =~ s/\(//g;
  $newfilename =~ s/\)//g;
  $newfilename =~ s/'//g;
  $newfilename =~ s/\!//g;
  $newfilename =~ s/\///g;
  if ( $iter != "0" )
  {  $newfilename = sprintf "%s_%d%s", $newfilename, $iter, ".mp4"  }
else { $newfilename = sprintf "%s%s", $newfilename, ".mp4" }
  $iter ++;
  $secs = $secs + $iter; // creates unique chan_starttime for db entry
  $newstarttime = sprintf "%04d-%02d-%02d %02d:%02d:%02d",
                    $year, $month, $day, $hour, $mins, $secs;
} while  ( -e "$dir/$newfilename" );

$DEBUG && print "$dir/$newfilename seems unique\n";
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20110216/38c4cca0/attachment.html 


More information about the mythtv-users mailing list