Hi all, and thanks for any helpful advice.
I’m trying to develop a channel for my own personal use. I’m running PMS on Centos7.
I installed my plugin in /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/, chown’d to plex:plex, and restarted PMS. However, when I go into Channels from the webapp, Plex deletes my channel. It doesn’t show up, and when I list the contents of Plug-ins/ my plugin is gone. I checked permissions, and they are the same as other installed plugins.
As an aside: how can I set the background artwork for each VideoClipObject ?
Here’s my .bundle/Content/Code/init.py:
#####################################################################
# Plugin to package downloaded soccer games for easy streaming via
# Plex.
TITLE = 'Soccer Matches'
RSS_FEED = 'http://***.***.***.***/soccer/matches.rss'
ART = 'art-default.jpg'
ICON = 'icon-default.png'
ICON_SEARCH = 'icon-search.png'
#####################################################################
# This (optional) function is initially called by the PMS framework to
# initialize the plug-in. This includes setting up the Plug-in static
# instance along with the displayed artwork.
def Start(): # Initialize the plug-in
Plugin.AddViewGroup("Details", viewMode="InfoList", mediaType="items")
Plugin.AddViewGroup("List", viewMode="List", mediaType="items")
# Setup the default attributes for the ObjectContainer
ObjectContainer.title1 = TITLE
ObjectContainer.view_group = 'List'
ObjectContainer.art = R(ART)
# Setup the default attributes for the other objects
DirectoryObject.thumb = R(ICON)
DirectoryObject.art = R(ART)
VideoClipObject.thumb = R(ICON)
VideoClipObject.art = R(ART)
# Plugin's unique identifier
# Type: Video
# Name: soccermatches
@handler('/video/soccermatches', TITLE)
def MainMenu():
oc = ObjectContainer()
for match in XML.ElementFromURL(RSS_FEED).xpath('//match'):
competition = match.xpath('./competition')[0].text
competitor1 = match.xpath('./competitors')[0].text
competitor2 = match.xpath('./competitors')[1].text
title = competition + " : " + competitor1 + " vs " + competitor2
url = match.xpath('./link')[0].text
date = match.xpath('./date')[0].text
date = Datetime.ParseDate(date)
summary = match.xpath('./description')[0].text
data = HTTP.Request(match.xpath('./thumb')[0].get('url'))
thumb = DataObject(data, 'image/jpeg')
oc.add(VideoClipObject(
url = url,
title = title,
summary = summary,
thumb = thumb,
originally_available_at = date
))
return oc