<div class="gmail_quote">On Wed, Feb 16, 2011 at 10:11 AM, Raymond Wagner <span dir="ltr">&lt;<a href="mailto:raymond@wagnerrp.com">raymond@wagnerrp.com</a>&gt;</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>
&gt; <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&#39;m not entirely sure how it&#39;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&#39;t understand why the database<br>
wouldn&#39;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 &quot;&quot; || $seasonnumber eq &quot;&quot; || $episodenumber eq &quot;&quot; )<br>  {<br>    $newfilename = sprintf &quot;%s_%s.%s.%s&quot;, $showtitle, $month, $day, $year;<br>
  } else {<br>    $newfilename = sprintf &quot;%s_S%0sE%0s_%s&quot;, $showtitle, $seasonnumber, $episodenumber, $episodetitle;<br>  }<br>  $newfilename =~ s/\;/   AND   /g;<br>  $newfilename =~ s/\&amp;/   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/&#39;//g;<br>  $newfilename =~ s/\!//g;<br>  $newfilename =~ s/\///g;<br>
  if ( $iter != &quot;0&quot; ) <br>  {  $newfilename = sprintf &quot;%s_%d%s&quot;, $newfilename, $iter, &quot;.mp4&quot;  } else { $newfilename = sprintf &quot;%s%s&quot;, $newfilename, &quot;.mp4&quot; }<br>  $iter ++;<br>
  $secs = $secs + $iter; // creates unique chan_starttime for db entry<br>  $newstarttime = sprintf &quot;%04d-%02d-%02d %02d:%02d:%02d&quot;,<br>                    $year, $month, $day, $hour, $mins, $secs;<br>} while  ( -e &quot;$dir/$newfilename&quot; );<br>
<br>$DEBUG &amp;&amp; print &quot;$dir/$newfilename seems unique\n&quot;;</pre><br>