[mythtv-users] Plex integration.

myth tv mythtv at cain.id.au
Thu Mar 18 22:13:57 UTC 2021

On Thu, Mar 18, 2021 at 9:20 PM Mike Perkins
<mikep at randomtraveller.org.uk> wrote:
> On 18/03/2021 03:36, myth tv via mythtv-users wrote:
> > On Wed, Mar 17, 2021 at 10:55 PM Richard Shaw <hobbes1069 at gmail.com> wrote:
> >>
> >> On Tue, Mar 16, 2021 at 10:34 PM myth tv via mythtv-users <mythtv-users at mythtv.org> wrote:
> >>>
> >>>
> >>> Here is the main part of the scripts:
> >>>
> >>> record_finish.sh
> >>> sleep 10
> >>> /usr/bin/ionice -c 3 /usr/bin/nice -n 19
> >>> /usr/share/doc/mythtv-backend/contrib/user_jobs/mythlink.pl
> >>> --destination /tv/show_names/ --filename $1 --underscores --maxlength
> >>> 120 --format "%U/%T/%Y-%m-%d %S S%ssE%ep"
> >>> sleep 2
> >>> /usr/bin/ionice -c 3 /usr/bin/nice -n 19
> >>> /usr/share/doc/mythtv-backend/contrib/user_jobs/mythlink.pl
> >>> --destination /tv/show_names-movies/ --filename $1 --maxlength 120
> >>> --format "%U/%T/%T - %Y-%m-%d (%oY) %S"
> >>
> >>
> >> How does it differentiate between a TV show or a movie? Or does it just mangle one or the other so it doesn't work in Plex?
> >>
> >
> > I do two things to differentiate TV Shows and Movies.
> >
> > 1. Create different two directory structures and filenames because
> > Plex needs different structures for TV and Movies.
> > 2. I use %U to separate out which mythtv programs are Movies and which
> > are TV Shows.  This means using different recording groups for TV and
> > Movies when setting up a recording rule.
> >
> > Then in Plex I point to the TV show recording groups in the first
> > mythlink directory structure when adding TV shows to the Plex library.
> > Then I point to the Movies recording groups in the second mythlink
> > directory structure for the Plex Movies library.
> >
> Yeah, but... your script above places links in /both/ Movies and TV directories at the end of every
> program.

That's correct, each program is creates a mythlink twice because I
don't check at the time of creating the mythlink whether it is a movie
or TV show. I guess it could be smarter and test the %U value and only
create either the TV or Movie link.
However, in Plex libraries I don't point to the top of the Movie or TV
directory structure but to the relevant %U sub-directories.
These are my Recording Groups (%U)
Children's TV
Children's Movies
Movies Classic
etc. etc.

So in Plex when creating my Movie Library, I add all the directories
for "movie type" recording groups but only in the second mythlink
movie directory structure.  That way Plex knows they are movies and
uses the correct information (directory structure and filename) for
the database grabbers.
While for the TV Show Library, I add recording group directories from
the first mythlink directory structure.  This directory structure is
in the format that Plex likes to gather TV show information.

BTW: The mythlink options may not be optimized for Plex or the quality
of the guide data of others.  I've moved from Plex to Jellyfin and
find my mythlink options quite good for the guide data I have.

Perhaps it is a good idea to test the %U value and only create the
mythlink once, then Plex would just need the top level directory in
each TV and Movie libraries.  However, the for the way above  I do get
to choose what is included or excluded from Plex based on mythtv
recording category.

More information about the mythtv-users mailing list