[mythtv-users] Plex plugin to access recordings

Richard Shaw hobbes1069 at gmail.com
Sun Nov 29 13:25:54 UTC 2020


On Sun, Nov 29, 2020 at 2:16 AM Jean-Yves Avenard <jyavenard at gmail.com>
wrote:

> Hi.
>
> Is there a plex plugin available, or any other solutions that would
> let you access mythtv recordings on a plex server?
>

I use  a systemd service and timer to create symlinks that Plex can
understand. It runs pretty much at midnight every night so they'll show up
the day after they record which is "good enough". Some kind of plugin that
would manage the symbolic links on the fly would be awesome, because when a
recording is expired it will still show up in Plex until the next
mythlink.sh run.

# systemctl cat mythlink.timer
# /etc/systemd/system/mythlink.timer
[Unit]
Description=Timer for the mythlink service

[Timer]
#OnCalendar=*-*-* 00:00:00
OnCalendar=daily
#OnUnitActiveSec=1d

[Install]
WantedBy=multi-user.target

# systemctl cat mythlink.service
# /etc/systemd/system/mythlink.service
[Unit]
Description=Update symbolic links of recordings for Plex
After=mythbackend.service
Requisite=mythbackend.service

[Service]
Type=simple
ExecStart=/usr/local/libexec/mythlink.sh

# cat /usr/local/libexec/mythlink.sh
#!/bin/env bash

PLEXDIR=/var/lib/mythtv/plex

if [[ $# -eq 0 ]]; then
# Run for all recordings
/usr/local/bin/mythlink --link $PLEXDIR --format "%T - s%sse%ep"
/usr/bin/symlinks -c $PLEXDIR
else
# Run for a single recording
/usr/local/bin/mythlink --link $PLEXDIR --format "%T - s%sse%ep" \
--chanid $1 --starttime $2
/usr/bin/symlinks -c $PLEXDIR
fi

Thanks,
Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20201129/43e32809/attachment.htm>


More information about the mythtv-users mailing list