<div class="gmail_quote">On Wed, Feb 16, 2011 at 10:11 AM, Raymond Wagner <span dir="ltr"><<a href="mailto:raymond@wagnerrp.com">raymond@wagnerrp.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 2/16/2011 12:46, Robert Houghton wrote:<br>
> <a href="http://www.mythtv.org/wiki/High_Quality_Transcode" target="_blank">http://www.mythtv.org/wiki/High_Quality_Transcode</a><br>
<br>
After looking at this script, I'm not entirely sure how it's working.<br>
The chanid/starttime pair in the recorded table is the primary key, and<br>
thus must be unique. In your script, when inserting the new recording,<br>
you replace the old starttime with a new one. However reading back<br>
through the code, you split apart the old starttime, and use that to<br>
create the same exact new time. I don't understand why the database<br>
wouldn't refuse the new record every time, and cause the script to die<br>
at the end.<br>
_______________________________________________<br>
mythtv-users mailing list<br>
<a href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a><br>
<a href="http://mythtv.org/mailman/listinfo/mythtv-users" target="_blank">http://mythtv.org/mailman/listinfo/mythtv-users</a><br>
</blockquote></div><br>Seconds are incremented.<br><br><pre>do {<br> if ( $episodetitle eq "" || $seasonnumber eq "" || $episodenumber eq "" )<br> {<br> $newfilename = sprintf "%s_%s.%s.%s", $showtitle, $month, $day, $year;<br>
} else {<br> $newfilename = sprintf "%s_S%0sE%0s_%s", $showtitle, $seasonnumber, $episodenumber, $episodetitle;<br> }<br> $newfilename =~ s/\;/ AND /g;<br> $newfilename =~ s/\&/ AND /g;<br> $newfilename =~ s/\s+/ /g;<br>
$newfilename =~ s/\s/_/g;<br> $newfilename =~ s/:/_/g;<br> $newfilename =~ s/__/_/g;<br> $newfilename =~ s/\(//g;<br> $newfilename =~ s/\)//g;<br> $newfilename =~ s/'//g;<br> $newfilename =~ s/\!//g;<br> $newfilename =~ s/\///g;<br>
if ( $iter != "0" ) <br> { $newfilename = sprintf "%s_%d%s", $newfilename, $iter, ".mp4" } else { $newfilename = sprintf "%s%s", $newfilename, ".mp4" }<br> $iter ++;<br>
$secs = $secs + $iter; // creates unique chan_starttime for db entry<br> $newstarttime = sprintf "%04d-%02d-%02d %02d:%02d:%02d",<br> $year, $month, $day, $hour, $mins, $secs;<br>} while ( -e "$dir/$newfilename" );<br>
<br>$DEBUG && print "$dir/$newfilename seems unique\n";</pre><br>