<div dir="ltr"><div dir="ltr">On Sun, Nov 29, 2020 at 2:16 AM Jean-Yves Avenard <<a href="mailto:jyavenard@gmail.com">jyavenard@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi.<br>
<br>
Is there a plex plugin available, or any other solutions that would<br>
let you access mythtv recordings on a plex server?<br></blockquote><div><br></div><div>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.</div><div><br></div><div># systemctl cat mythlink.timer <br># /etc/systemd/system/mythlink.timer<br>[Unit]<br>Description=Timer for the mythlink service <br><br>[Timer]<br>#OnCalendar=*-*-* 00:00:00<br>OnCalendar=daily<br>#OnUnitActiveSec=1d<br><br>[Install]<br>WantedBy=multi-user.target<br></div><div><br></div><div># systemctl cat mythlink.service<br># /etc/systemd/system/mythlink.service<br>[Unit]<br>Description=Update symbolic links of recordings for Plex<br>After=mythbackend.service<br>Requisite=mythbackend.service<br><br>[Service]<br>Type=simple<br>ExecStart=/usr/local/libexec/mythlink.sh<br></div><div><br></div><div># cat /usr/local/libexec/mythlink.sh <br>#!/bin/env bash<br><br>PLEXDIR=/var/lib/mythtv/plex<br><br>if [[ $# -eq 0 ]]; then<br>      # Run for all recordings<br>      /usr/local/bin/mythlink --link $PLEXDIR --format "%T - s%sse%ep"<br>    /usr/bin/symlinks -c $PLEXDIR<br>else<br>   # Run for a single recording<br>  /usr/local/bin/mythlink --link $PLEXDIR --format "%T - s%sse%ep" \<br>          --chanid $1 --starttime $2<br>    /usr/bin/symlinks -c $PLEXDIR<br>fi<br></div><div><br></div><div>Thanks,</div><div>Richard</div></div></div>