[mythtv-users] add season and episode number to mythlink.pl

Matt Emmott memmott at gmail.com
Mon Dec 31 02:36:40 UTC 2012


On Fri, Dec 28, 2012 at 12:33 PM, Andre Ross <andre.ross at sbcglobal.net>wrote:

> Matt
>
> That is one of the reasons I use this script its because I use Mythtv and
> Plex.
> I forgot to put the comment start of hack, the start of the hack is the
> below comments in the script mythlink.pl
>
>
> #######################################################
> #
> # find this statment and place hack after my $name =
> #
>
> #
> # end of hack
> ########################################################
>
> Make sure you run the script on the backend if the frontend/backend are
> not on the same system.
> If you run it from the command line, you have to make sure that the user
> that runs the script under has access mythtv.
> remember if you run the command as root the symlinks will be owned by root.
>
> On my system the recording are located:
> /var/lib/mythtv/recordings/
>
> With a names like:
> 1206_20121204042900.mpg
>
> So you got the format right leaving off the file name create symlinks of
> all your recordings.
>
> 2) How would I run this manually to test? Would it be
> mythlink.pl
>  --link "/destination/of/symlink" --filename "/myfilename.mpg" --format
> "%T/Season %qs2/%T-S%qs2E%qe2-%S" --separator "#"
>
> And if I wanted to run it once against all the recordings in that
> directory, just leave off the filename argument:
> mythlink.pl --link "/destination/of/symlinks" --format "%T/Season
> %qs2/%T-S%qs2E%qe2-%S" --separator "#"
>
>
>

So, some updates:

First, I prefer to have all seasons of each recording dumped into their own
folder rather than separating them by season 1, season 2 etc. I did this by
running the following:

/mythlink.pl --link show_names/ --format "%T/%T-S%qs2E%qe2-%S" --separator
"#"

And it's AWESOME. So much more usable so far than Mythical Librarian ever
was.

But I ran into a usability issue that may be of concern. From reading this
on the mythlink.pl wiki page, I think your method will end up with a lot of
dead symlinks:

"Note that when specifying --filename or --chanid and --starttime, deletion
of old symlinks is suppressed."

It does say that running mythlink without those switches will blow away all
old symlinks first, which at first glance sounds good. However, as i
discovered, it recreates all the symlinks which means they all have new
datestamps. This means that A) Plex has to re-index everything every time
there's a refresh and B) The "Recently Added" sort option would never work
(which I use constantly).

I did some digging and found that I could run the following to find and
delete orphaned symlinks:

find /var/lib/mythtv/recordings/show_names/ -type l ! -exec test -e {} \;
-exec rm {} \;

I'm going to do some more testing but I think using your user job and a
cron job of the above find command might be a good way to go, and I can
disable Mythical Librarian altogether.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20121230/fbd1b1c6/attachment.html>


More information about the mythtv-users mailing list