LinHES Forums
http://forum.linhes.org/

A change to mythlink.sh (pretty script)?
http://forum.linhes.org/viewtopic.php?f=6&t=3644
Page 1 of 1

Author:  ceenvee703 [ Tue Feb 22, 2005 12:53 pm ]
Post subject:  A change to mythlink.sh (pretty script)?

Now that I've updated my backend to R5V10, the mythlink.sh script now fills the /myth/pretty folder with symlinks that have a date at the front of the name (nice), but no longer have an ".mpg" extender for my PVR-x50 recordings. I'd like to add this back for my setup, which only has .mpg recordings.

I found the thread that described how to modify the original mythlink.sh script:

http://mysettopbox.tv/phpBB2/viewtopic.php?t=498

but the new one doesn't have the same line 33 for editing to add the .mpg extender ($goodfile{$nfn .".mpg"} = 1)

Is anyone else seeing this, and does anyone with more scripting experience have an idea where I could add this? Thanks.

Author:  cecil [ Tue Feb 22, 2005 1:00 pm ]
Post subject:  Re: A change to mythlink.sh (pretty script)?

ceenvee703 wrote:
Now that I've updated my backend to R5V10
Man are you ahead of the game. Can you tell me what improvements it has? That way I can improve it faster? Thanks!

Author:  ceenvee703 [ Tue Feb 22, 2005 3:32 pm ]
Post subject: 

D'oh. :(

OK, R5A10...

Author:  tjc [ Tue Feb 22, 2005 9:54 pm ]
Post subject: 

Well my copy of the Hitchhikers Guide to the Galaxy which fell through a wormhole from the future describes R5V10 as not just the preimer, but indeed the ultimate PVR distro, and says that Cecil and Dale are regarded as living legends. ;-) It also says that the graphical installer is unbelievably brilliant and intuttive with an almost supernatural ability to detect and configure for almost any hardware. ;-)

Author:  Greg Frost [ Tue Feb 22, 2005 10:22 pm ]
Post subject: 

But it's still really difficult to get the PVR350 TV out working. :lol: :( :shock:

Author:  tjc [ Tue Feb 22, 2005 10:25 pm ]
Post subject: 

I did say "almost any hardware" and "living legends" rather than god-like superbeings. ;-)

Author:  cecil [ Tue Feb 22, 2005 10:31 pm ]
Post subject: 

:D LOL

Author:  nigelpearson [ Wed Feb 23, 2005 1:34 am ]
Post subject:  Re: A change to mythlink.sh (pretty script)?

ceenvee703 wrote:
I found the thread that described how to modify the original mythlink.sh script:

http://mysettopbox.tv/phpBB2/viewtopic.php?t=498

but the new one doesn't have the same line 33 for editing to add the .mpg extender ($goodfile{$nfn .".mpg"} = 1)


That thread has a new (modified) script at the top which contains 49 lines. Its line 33 looks like:

$goodfile{$nfn} = 1;

That is the line 33 to change, et c. Try replacing your current mythlink.sh with the one in that page, then do the edits mentioned later in the thread.

Author:  ceenvee703 [ Wed Feb 23, 2005 4:14 am ]
Post subject: 

Nigel, thanks for the help. I appreciate it.

I realize I could use that script, then make the changes described at the end of the thread. I'd prefer to make the changes to the current script, which seems to have changed quite a bit (it doesn't have the $goodfile variable in it at all).

Author:  ille [ Mon Mar 07, 2005 1:55 am ]
Post subject: 

I've updated from R4V4.1 to R5A12 and I added one row in the mythlink.sh

Code:
$nfn =  "$nfn.mpg";


before the line
Code:
print "Creating $nfn\n";


/Christian

Author:  ceenvee703 [ Mon Mar 07, 2005 4:02 am ]
Post subject: 

That did the trick; thanks!

Author:  lynchaj [ Sun May 01, 2005 7:14 pm ]
Post subject: 

Hi,

I run R4V5 and made the changes to mythlink.sh as requested in the KnoppMyth wiki and discussed above. However, I believe there exists a bug in the perl script when there are files from a series that share the same name but are different in the description. An example of the error message is below.

Failed to create symlink /myth/pretty/Battlestar_Galactica-The_Lost_Warrior.mpg: File exists at -e line 39, <> line 49.

The show is the classic BSG and there are 2 versions of "The Lost Warrior" each with different descriptions.

I searched the forum on how to deal with near duplicates. Would you modify the script to deal with this special case such as add the record date to the filename?

Thank you.

Andrew Lynch

Author:  ceenvee703 [ Mon May 02, 2005 5:46 am ]
Post subject: 

Andrew: the version of the script that comes with the R5 alpha does include the record date in the name... other than helping with conflicts like yours, it also results in lists being sorted chronologically.

When I updated to the most recent alpha, though, it wiped out the above changes to the script. Must remember to copy stuff like this to my home directory so it gets backed up...

Author:  lynchaj [ Tue May 03, 2005 4:37 pm ]
Post subject: 

Does the updated mythlink.sh work in R4? If so would you be so kind as to post the updated script so I could replace my mythlink.sh?

Thanks!

Andrew Lynch

Author:  ceenvee703 [ Wed May 04, 2005 8:10 am ]
Post subject: 

Andrew: here you go. This includes the above modification to add ".mpg" extensions.

Code:
#!/bin/sh

# mythlink.sh - Symlinks mythtv files to more readable version in /var/lib/mythtv/pretty
# by Dale Gass

rm -f /tv/pretty/*
echo "Done RM"
mysql -uroot mythconverg -B --exec "select chanid,DATE_FORMAT(starttime,'%Y%m%d%H%i%s'),DATE_FORMAT(endtime,'%Y%m%d%H%i%s'),title,subtitle from recorded;" >/tmp/mythlink.$$
perl -w -e '
        my $mythpath= "/myth/tv";
        my $altpath= "/myth/pretty";
        if (!-d $altpath) {
                mkdir $altpath or die "Failed to make directory: $altpath\n";
        }
        <>;
        while (<>) {
                chomp;
                my ($chanid,$start,$end,$title,$subtitle) = split /\t/;
                $start =~ s/[^0-9]//g;
                $end =~ s/[^0-9]//g;
                $subtitle = "" if(!defined $subtitle);
                my $ofn = "${chanid}_${start}_${end}.nuv";
                do { print "Skipping $mythpath/$ofn\n"; next } unless -e "$mythpath/$ofn";
                $start =~ /^....(........)/;
                my $nfn = "$1_${title}_${subtitle}";
                $nfn =~ s/ /_/g;
                $nfn =~ s/&/+/g;
                $nfn =~ s/[^+0-9a-zA-Z_-]+/_/g;
                $nfn = "$nfn.mpg";
                print "Creating $nfn\n";
                unlink "$altpath/$nfn" if(-e "$altpath/$nfn");
                symlink "$mythpath/$ofn", "$altpath/$nfn" or die "Failed to create symlink $altpath/$nfn: $!";
        }
' /tmp/mythlink.$$
rm /tmp/mythlink.$$


Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/