[mythtv] Re: [mythtv-commits] Ticket #857: Patch to mythrename.pl to work correctly with slave backends

Tom Lichti tom at redpepperracing.com
Fri Dec 23 09:22:34 EST 2005


Michael T. Dean wrote:
>>
>> Hrm. Might be related to the fact that I added that whole 
>> sub-directory thing... :)
>
> Yeah.  Since it only checks the destination directory (and not 
> subdirs), that would be the problem.  The old mythlink.sh used to "rm 
> -rf" the whole destination directory, so that's why it worked.
That's what I did.... :)
>>>
>>> I'm doing a slightly easier thing that may work for you.  Instead of 
>>> grouping shows by folder, I create several folders with different 
>>> "views" of the files--each sorted differently.  I have a script 
>>> (mythlink.sh) which creates the views (so I can run a single cron 
>>> job to create them all).
>>
>> Perfect! I'll use this and then I'll stop complaining... :)
>
> Although I'll admit that your approach had one benefit mine didn't: 
> you could list the directories to quickly see/count what different 
> titles you have available.  (Didn't lose sight of the forest for the 
> trees.)
Not sure I see your point here, doesn't your solution do basically the 
same thing?
>
> If you know of a not-so-hackish way to do this (you mentioned you 
> hacked yours), you could add a ticket.  If not, maybe someone more 
> creative than I will help figure one out.  Of course, as deep in the 
> thread as we've taken this, the request probably won't be seen by 
> anyone who could help.  If you really want the ability, you may want 
> to start an "any ideas" thread on -users...
>
All I did was this:

             }
             $name .= $suffix;
         # Create the link
-            symlink "$video_dir/".$info{'basename'}, "$dest/$name"
+           `mkdir "$dest/$info{'title'}"`;
+            symlink "$video_dir/".$info{'basename'}, 
"$dest/$info{'title'}/$name"
                 or die "Can't create symlink $dest/$name:  $!\n";
             print "$dest/$name\n";
         }


Not very elegant, it doesn't check if the directory exists, but it works 
the way I want it to. To make it more robust, it should check if the 
directory is already there, remove it if it's not needed, verify that it 
got created correctly, etc. Even nicer if it could be customized to 
decide what item you want to make subs for.

Anyway, I think we've beaten this one to death....

Tom


More information about the mythtv-dev mailing list