NextPVR Forums

Full Version: Jellyfin - Automate EPG updates
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have attached a simple program that will allow you to trigger a jellyfin EPG update after NextPVR's EPG update has finished.  Using this approach you don't have to rely on a scheduled "Refresh Guide" task and it probably can be disabled.  Alternatively JellyRoll will check and if you have the Refresh Guide task scheduled in the upcoming 15 minutes JellyRoll won't trigger an update.  Boths update should be sheduled in off hours, the jellyfin update can be long.

To install, unzip the file into NextPVR's program directory  typically "C:\Program Files\NextPVR" or /opt/system/nextpvr  or /apps on Docker

To run you will to create an API key which is easily available using the jellyfin dashboard.

The  following lines need to be added into PostUpdateEPG.bat

Code:
C:
cd "C:\Program Files\NextPVR"
JellyRoll.exe APIKEY   {IP} {port}

or on linux PostUpdateEPG.sh (remember to chmod +x)

Code:
cd /opt/nextpvr/system
/opt/dotnet/dotnet JellyRoll.dll APIKEY {IP} {port}

On Docker your might need to unzip into /config and then copy them into /app from bash

Code:
cd /app
dotnet JellyRoll.dll APIKEY {IP} {port}

IP and port are optional on localhost and with default port 8096


Martin
Hi,



Thank you very much for providing the JellyRoll tool which I installed on my media server under Debian where NextPVR and Emby is located.

At first, I realized that JellyRoll expects the NextPVR data directory to be located below the user's home directory in ~/.NextPVR-data or even at /.NextPVR-data. As NextPVR located the data directory at /var/opt/nextpvr, I created a symbolic link first so that JellyRoll can access the correct data directory:

ln -s /var/opt/nextpvr /.NextPVR-data


I understood that JellyRoll needs to be triggered after an EPG update at NextPVR. Therefore, I placed the following commands into the file /var/opt/nextpvr/scripts/PostUpdateEPG.sh:



cd /opt/nextpvr/system
/opt/dotnet/dotnet /opt/nextpvr/system/JellyRoll.dll <myApiKey>

I ran the following commands:
sudo chown nextpvr /var/opt/nextpvr/scripts/PostUpdateEPG.sh
sudo chmod +x /var/opt/nextpvr/scripts/PostUpdateEPG.sh

Manual execution for test purposes:
sudo -u nextpvr /var/opt/nextpvr/scripts/PostUpdateEPG.sh

Output:
jellyroll:1.0.0.0
IntervalTrigger

However, I am not aware what I need to do inside the Emby backend so that the EPG update arrives at the right place. Of course, I created the API Key for JellyRoll, but Emby Live TV Backend still shows that my channels do not have an assigned EPG data source.

At the moment, I am a bit lost as how to continue. Thanks a lot for your explanations.


Best regards,

Peter
If you the install this according to the directions in PostUpdateEpg.sh it runs every time after the EPG is updated with the proper environment variables that the service uses. Why would you need to do this as a cron job?

Martin
(2021-06-01, 12:51 PM).mvallevand Wrote: [ -> ]If you the install this according to the directions in PostUpdateEpg.sh it runs every time after the EPG is updated with the proper environment variables that the service uses.  Why would you need to do this as a cron job?

Martin

Sorry! I had some misunderstandings and updated my Reply #2 accordingly. I have placed now the scripts at the foreseen place. As you see in my updated reply, JellyRoll seems to be regularly executed, but I do not know which further steps are required on the Emby side that the EPG data are displayed there. When I open LiveTV, the EPG is still empty, even after a restart of both the NextPVR and Emby Server.

I have Emby Server 4.6.1.0 in combination with NextPVR 5.1.1.210329 and the NextPVR Plugin 3.3.3.0. Should it work under this constellation?

When I open the Emby Backend and go to Live TV > Channels, I see all my channels, but there is still a remark that no EPG is assigned to any of the channels. I this correct or needs anything further to be done? 

Thanks a lot for your explanations.

Best regards,
Peter
If you don't run the test from within NextPVR with a manual Update EPG update and just want to test the trigger you should run

NEXTPVR_DATADIR_USERDATA=/var/opt/nextpvr/ sudo -u nextpvr /var/opt/nextpvr/scripts/PostUpdateEPG.sh

Then zip and upload jellyroll.log from the /var/opt/nextpvr/logs and I can see what is going on.

Martin
The log file is pretty compact:


Quote:[...startup]
2021-06-01 14:52:44.517 [DEBUG][1] jellyroll:1.0.0.0
2021-06-01 14:52:44.518 [DEBUG][1] http://localhost:8096/emby/ScheduledTask...key=hidden
2021-06-01 14:52:44.518 [DEBUG][1] Getting tasks
2021-06-01 14:52:44.632 [DEBUG][1] Found tasks
2021-06-01 14:52:44.841 [DEBUG][1] Refresh guide starting
2021-06-01 14:52:44.851 [DEBUG][1] Refresh guide activated
2021-06-01 14:52:44.851 [DEBUG][1] Exit
That perfect and shows it is working, so this becomes a support post on the Emby forum with Emby logs. I wanted to make sure the proper steps were done first.

Keep it separate from your other post since this has nothing to do with OTA data from Emby tuners this triggers and update of the NextPVR plugin.

Martin