SageTV for Plex Media Server (and Roku Too!)
Requirements
Plex Media Server (PMS) 0.9.5 or newer installed on one computer: * OS X: download installation instructions * Windows: download installation instructions * Linux: download (installation instructions are located on the download page); see also various Linux distros.
Be sure you're installing Plex Media Server and NOT Plex Media Center You can install the Plex Media Center software on Mac and PCs if you want to use them as Plex clients with access to SageTV recordings but the Plex Media Server must be installed first.
SageTV server software * v7.1.9 installed (no longer available for download) SageTV Batch Metadata Tools (BMT) Web Interface Plug-in * v4.10 installed (via the SageTV plugins manager) SageTV sagex-services plugin * installed (this will also install the Jetty Web Server if it's not already installed) SageTV Customer Scanner (for Plex Media Server) * custom code downloaded and installed from this project site SageTV BMT Agent (for Plex Media Server) * custom code downloaded and installed from this project site plex.js file for SageTV server * custom code downloaded and installed from this project site
Optional
- Roku Box with Plex Channel installed
- Plex Media Center installed Windows or OS X
- Or really any Plex-supported client :)
Introduction
This document will not cover specific steps on how to install the SageTV Server or the Plex Media Server. It is also assumed that the user is somewhat familiar with the Plex Media Manager (browser-based access to the Plex media library / database).
Installation
Installing sagex-services plugin for SageTV Server
sagex-services is SageTV plugin that allows remote access to the SageTV API for developers that wish to access various aspects of the SageTV server. This plug-in must be installed on your SageTV server.
- Open SageTV Placeshifter, turn on an Extender or open the SageTV UI on the server
- Go to the SageTV Plugin Manager by following the menus to Setup -> SageTV Plugins -> All Available Plugins
- From the General tab, scroll to "sagex-services - SageTV Remote API Services" and select it.
- Install the plugin, and restart SageTV server when prompted. Note: this will also install the Jetty Web Server. Optional: configure the user name, password, and port for the Jetty Web Server (by default, they are respectively: sage frey and 8080)
- Open SageTV Placeshifter, turn on an Extender or open the SageTV UI on the server
- Go to the SageTV Plugin Manager by following the menus to Setup -> SageTV Plugins -> Installed Plugins
- From the General tab, scroll to the Jetty Web Server plugin and select it. An options dialog is displayed
- Choose Configure Plugin. A screen with the plugin's configuration settings is displayed
- Update the user name, password, and port as you like. Be sure to select "Restart Web Server" when you're done. Please note: SSL connections are not currently supported in the SageTV for Boxee app
- Make a note of the user name, password and port since these will be used to configure the SageTV for Boxee app Note: the Jetty Web Server is installed as a part of installing the sagex-services plugin but will not be used by Plex Media Server. See: Jetty Web Server plugin wiki for complete information.
Installing the SageTV Custom Code for Plex Media Server
Part 1
- Download the sagetv-for-plexmediacenter.zip file
- Find where your Plex Media Server main folder is:
- OS X: ~/Library/Application Support/Plex Media Server
- Windows 7: C:\Users_your_user_name_\AppData\Local\Plex Media Server
- Vista: C:\Documents and Settings_your_user_name_\Application Data\Plex Media Server
- Linux ???
- Unzip the zip file, targeting the top level Plex folder from above.
The following folder/files will be installed:
Scanner
--Movies
----SageTV Movie Scanner.py
--Series
----simplejson
------files
----SageTV Scanner.py
Plug-ins
--BMTAgent.bundle
----Contents
------Code
--------__init__.py
--------BMTAgent.properties
------Resources (stuff)
------Info.plist
------VERSION
Part 2
Install the plex.js file on the SageTV server:
- Download the sagex.zip file
- Unzip the zip file into SageTV\SageTV\sagex\services
- plex.js should be listed
Configuration
Three files in the Plex Media Server will need to be updated manually with the location of the SageTV server:
- Plug-ins\BMTAgent.bundle\Contents\Code\BMTAgent.properties
- Scanners\Series\SageTV Scanner.py
- Scanners\Movies\SageTV Movie Scanner.py
Update each of the following files with the correct IP address:
BMTAgent.properties, update the SAGEX_HOST line: * SAGEX_HOST=http://user:pass@IPAddress:PortNo
SageTV Scanner.py, update the SAGEX_HOST line: * SAGEX_HOST = 'http://user:pass@IPAdress:PortNo'
SageTV Movie Scanner.py, update the SAGEX_HOST line: * SAGEX_HOST = 'http://user:pass@IPAdress:PortNo'
NOTE: in the scanner files, single quotes are needed
NOTE: only use user:pass in the URL if your web server is password protected. You can test access via: http://IPAddress:PortNo/sagex/api
Setup and Scanning
Once all the files have been installed, use the Plex Media Manager to add a new "section", containing SageTV recordings.
Set Up TV Shows for Scanning
- Using your browser, navigate to the Plex Media Manager page
e.g. http://localhost:32400/manage/index.html if accessing the manager from the same computer that Plex Media Server was installed.
- Click on "TV Shows"
- Enter the "Name:" you want the Section/Entry to show up as in Plex, e.g. Recorded TV Shows
- Click on the Add button
- Browse to and select your SageTV recordings folder(s):
- Alternatively, manually enter the folder path using the "Manual Entry" button.
- Click on "Advanced" in order to select the custom scanner (SageTV Scanner)
- and metadata agent (SageTV BMT Agent) for SageTV.
- Multiple SageTV recording folders can be added to a single section by using the Add button:
- And finally, click on "Add Section"
Plex will immediately start scanning the SageTV recordings folder(s); reload the page in order to see the "spinner" indicating the scan status:
Depending on the number of recordings it may take an hour or longer for all the files to be scanned and for the the Plex Media Server media database to be populated with SageTV metadata.
From a Plex client, this new section will show up with the same name assigned to it:
Set Movies for Scanning
Use the same steps to:
- Add a new section, selecting Movies
- Add the SageTV recording folder(s)
- Use the Advanced button and
- Select SageTV Movie Scanner for the Media Scanner
- Keep the default Freebase for the Primary Metadata Agent
- Click Add Section and Plex will be immediately begin scanning the SageTV recordings folder(s) for movies!
How to Apply Updates
The process is slightly cumbersome but it ensures that the Plex Media Server database doesn't get corrupted and that the metadata related to your SageTV recordings is stored in the PMS database correctly.
- From the Plex Media Manger web page, remove the sections that have your SageTV content
- Shutdown the Plex Media Server
- Download and unzip the new files per the original installation instructions near the beginning of this document.
Note: Remember to update the three files with the correct SAGEX_HOST hostname, etc.
- Start up the Plex Media Server
- Re-add your TV and Movies sections as before and Plex will re-scan your SageTV content using the updated scanners / agents.
Troubleshooting
There are two log files in the Logs folder in the Plex Media Server folder that may provide clues to any issues that might arise:
- Plex Media Server\Logs\Plex Media Scanner.log
- Plex Media Server\Logs\PMS Plugin Logs\com.plexapp.agents.bmtagent.log (and previous logs, .1, .2, etc)
For additional help, you can post to the official thread or if you find a bug, you can a submit a new issue.