[mythtv-users] mythrename.pl renames my .avi to .nuv

Robin Hill myth at robinhill.me.uk
Mon Jan 15 20:59:41 UTC 2007


On Mon Jan 15, 2007 at 11:46:50AM -0800, Brad DerManouelian wrote:

> On Jan 15, 2007, at 11:25 AM, Christophe Zwecker wrote:
> 
> > Brad DerManouelian wrote:
> >
> >>
> >> I'm not sure I understand.  You're changing the basename to .avi and
> >> the file on the disk to .avi and mythrename is changing it back
> >> to .nuv? I'm not sure how this is happening since the only place in
> >> the code that mentions nuv is line 385.
> >
> > mythrename.pl looks like this here:
> >
> > ---snip----
> >
> >      # Figure out the suffix
> >          my $out    = `file -b $safe_file 2>/dev/null`;
> > #        my $suffix = ($out =~ /mpe?g/i) ? '.mpg' : '.nuv';
> >           my $suffix = ($out =~ /mpe?g$/i) ? '.mpg' : '.nuv';
> >           $suffix = ".avi" if ( $out =~ /\.avi$/i );
> >      # Link destination
> >
> > ---snip---
> 
> Looks like it should work to me. Try putting in a bunch of print  
> statements to track the values of the varaibles at each step and see  
> if you can tell where the extension is changed to .nuv.
> 
No, it's working on the output from "file", not the file extension.
You'll want to revert to the original .mpg check (since it probably
won't appear at the end of the line), then add the following for AVI
detection:
        $suffix = ".avi" if ( $out =~ /avi/i );

Cheers,
        Robin
-- 
     ___        
    ( ' }     |       Robin Hill        <myth at robinhill.me.uk>  |
   / / )      | Little Jim says ....                            |
  // !!       |      "He fallen in de water !!"                 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20070115/2915e981/attachment.pgp 


More information about the mythtv-users mailing list