-
-
Notifications
You must be signed in to change notification settings - Fork 23
Tautulli Integration
If Plex is globally enabled, the Maker can monitor an episode's watched status (i.e. watched/unwatched) and modify its card accordingly (such as blurring/un-blurring). Enabling this functionality is detailed here. Normally, the process of replacing a card only happens every time the maker is run, which most users will not schedule very frequently (usually every 12 hours).
To address this, the Maker can integrate with Tautulli and bypass the normal (long) run process to specifically remake cards almost immediately after an episode has been watched. This is done by using Tautulli's ability to execute a custom script after an episode has been watched.
The Maker cannot set up this Tautulli integration for you, as setting up the custom notification agent must be done within the web interface. The process is quite simple, and detailed below.
NOTE: The process of installing and setting up Tautulli is not covered here. But it is fairly easily, especially compared to some other Plex-integration apps.
Because most users have Tautulli (and TitleCardMaker) running in Docker containers, it is not feasible to have the Maker and Tautulli directly communicate with eachother. To circumvent this, the two containers "communicate" only through a shared file. Adding this is step 1.
-
Navigate to the configuration directory for your instance of Tautulli. This might be
/Documents/Tautulli/config
, or/mnt/user/appdata/tautulli/
on Unraid. The specific directory isn't important, but it must be accessible within both your Tautulli docker container, and your host computer (if it is running in Docker). -
Within the configuration directory from 1.1, create a file called
update_card.sh
and put the following text:#!/bin/sh echo "$@" >> update.txt
The technical details of this file aren't relevant, but it basically writes whatever text we send to the file from Tautulli to a local file
update.txt
. -
If you're on Linux/MacOS, make sure the created file is executable by executing
chmod +x ./update_card.sh
from the command line/terminal.
We now need to tell Tautulli to execute the above script whenever an episode has been watched.
-
Navigate to your Tautulli web UI (probably some URL like
http://196.168.x.xx:8181/home
). -
In the top right corner, click the Gear icons and then enter the Settings menu.
Image
-
From the sidebar, select
Notification Agents
Image
-
Select
Add a new Notification Agent
Image
-
Scroll down to and click
Script
Image
-
On the
Configuration
tab, select theScript Folder
from the dropdown menu and navigate to the folder where the file from Step 1. -
Select the
Script File
as the file we created,update_card.sh
-
Enter some script timeout - I'd recommend between 30-120 seconds
-
Optionally enter some description like
Update TitleCardMaker
.Image
-
Go to the
Triggers
tab and toggle theWatched
checkbox.Image
-
Go to the
Conditions
tab and add two conditions (replacing YOUR USERNAME with your actual username):Condition Operator Value Username
is
YOUR USERNAME Media Type
is
episode
Image
This ensures the script is only run when you watch an episode of TV (not anyone watching anything).
-
Go to the
Arguments
tab, expandWatched
and in the text box enter the following:{rating_key}
Image
-
Select
Save
to exit the Notification Agent setup. -
Finally, Plex reports episodes as "watched" when 90% of their runtime has been viewed, so Tautulli needs to be configured to match this as well. Go to
General
on the sidebar, thenTV Episode Watched Percent
and enter90
(the other settings don't matter).Image
Now that Tautulli will write the rating key (think of this as a unique number the Maker can use to identify which episode you just watched) to the file (update.txt
) every time you watch an episode of TV, the only remaining part is to tell the Maker what file to look at, and how often.
-
You need to make sure the file we created in Step 1 is accessible within the TitleCardMaker container. This means passing the volume into the container. For example, if I created
update_card.sh
at/mnt/user/appdata/tautulli/update_card.sh
, then I need to ensure that/mnt/user/appdata/tautulli/
is passed into the container, let's choose to mount this at/tautulli
. -
Now we want to define the environment variables
TCM_TAUTULLI_UPDATE_LIST
and (optionally)TCM_TAUTULLI_UPDATE_FREQUENCY
in our Docker container so the Maker knows what file to look at. In my example, this is-e TCM_TAUTULLI_UPDATE_LIST="/tautulli/update.txt"
since the scriptupdate_card.sh
writes toupdate.txt
in that same directory. -
Launch the updated TitleCardMaker container. This command might look like:
$ docker run -dit --name TitleCardMaker \ {...} \ -v "/mnt/user/appdata/tautulli/":"/tautulli/" \ -e TCM_TAUTULLI_UPDATE_LIST="/tautulli/update.txt" \ -e TCM_TAUTULLI_UPDATE_FREQUENCY="4m" \ collinheist/titlecardmaker:master
Where
{...}
is the rest of your normal Docker configuration.