[mythtv-users] MythWeb filename to actual filename

Bobby Gill bobbygill at rogers.com
Fri Apr 3 19:20:45 UTC 2009


> Or, just use mythrename.pl --link...  I have my system set up to run it 5
> different times every half hour, creating 5 different directories sorted
> differently.  And, mythrename.pl --link will give you good filenames /after/
> the copy--meaning that when you throw them on the laptop, you'll know which
> shows to watch and in what order.
>
> http://www.gossamer-threads.com/lists/mythtv/users/331410#331410 has the
> script I run and explains the sorting.
>
>
Not to hijack the thread, but I just ran the mythrename.pl and got this:

/media/myth # /usr/share/mythtv/contrib/mythrename.pl --link --format
"%T-%S-%R_%Y.%m.%d"
Can't create symlink /media/myth/show_names/60 Minutes- Edited down to just
Ben Bernanke- Federal Reserve Chairman Ben Bernanke talks about what went
wrong with the country's financial system and when the recession might end;
Alice Waters has been touting the virtues of fresh foods grown in an
environmentally friendly way for decades._2009.03.15.mpg:  File name too
long
/media/myth #

Now from the wiki, I pasted this code:

   # Make the substitution
       my $keys = join('|', sort keys %fields);

       my $name = $format;
       $name =~ s#/#$dest ? "\0" : $separator#ge;
       $name =~ s/(?<!%)(?:%($keys))/$fields{$1}/g;
       #Shrink the description, if it is too long. I use 251 to
account for a 4 character file extension

       if($fields{R} && length($name) > 251) {
               $fields{R} = substr($fields{R}, 0, length($name)-251);
               $name = $format;
               $name =~ s#/#$dest ? "\0" : $separator#ge;

               $name =~ s/(?<!%)(?:%($keys))/$fields{$1}/g;
       }
       $name =~ s/%%/%/g;
   # Some basic cleanup for illegal (windows) filename characters, etc.


Right at the end of mythrename.pl as it stated (line 359). Still gave me
that error when running it, though.


Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20090403/d124a510/attachment.htm>


More information about the mythtv-users mailing list