A few of us have started maintaining a Google Doc with notes regarding stuff that is missing from the existing Plugin Framework Documentation. Obviously since the docs are one of the major sources of support for Channel Developers, those gaps in the knowledge base can be crippling, especially for people just getting started. The idea was to have the missing details added to the official docs but more-often-than-not documentation takes a back-seat to ongoing development. So, for the time being we decided to share a little extra knowledge with anyone who might be interested and might benefit from it.
We'll try to keep it up to date as new stuff gets added to the framework and we discover other undocumented tidbits. If you have questions about the contents of the google-doc or have found something that you think should be added, feel free to post in this thread.
Also some of the info in there may be a bit scattered, think of it more like a note pad than any sort of official documentation ;) If you have anything to add to it please feel free to post here as well. There are several of us with write access to that file.
After all, the more info we get collected into common repositories, the stronger both we and Plex stand.
Seems like a good idea. If you care to compile your notes in a g-doc (or similar) as a starting point, and post a link in the General Development forum, I'll make sure the thread gets stickied.
I'm not sure but I haven't been able to find this anywhere either.
To avoid importing the python re module in the channel code it is recommended to use Regex() from the framework to create a compiled pattern. So instead of:
import re
testString = “This string is for testing purpose”
“testing regexp”
testPattern = ‘(t.*)\s’
re.search(testPattern, testString).group(1)
we should be using:
testString = "This string is for testing purpose"
"testing regexp"
testPattern = Regex('(t.*)\s')
testPattern.search(testString).group(1)
But what happens if we need to specify a flag. If we want the dot to match newlines, or if we want to do a multiline search or ignore case. This is what I haven't found anywhere.
The constant for those flags would be:
Regex.DOTALL
Regex.IGNORECASE
Regex.MULTILINE
And we will use them this way:
testString = "This string is for testing purpose"
"testing regexp"
testPattern = Regex('(t.*)\s', Regex.DOTALL)
I just discovered that the EpisodeObject metadata object accepts the "content_rating" argument. This sets the rating that you see for each episode. The content_rating argument set for a TVShowObject only applies to the entire show and is not propagated to children episodeobjects as expected.
Also, thanks for this document. It's extremely useful and helpful. It's a shame that the Plex devs don't keep better documentation of the API. Then again, it's been years since they touched it or gave it any love. So it's not surprising. I have a feeling one of these days they'll just kill the entire channel API altogether. I mean, a dead API is almost worse than no API. /rant
Regarding the TrackObject, it says that it requires ‘ext=mp3’ for the PartObject in the MediaObject. The way I’ve setup TrackObject is by having a Callback that does a Return(url) with the mp3 file. This works in the web client, but not within the the client in Amazon Fire. When I try to add a MediaObject to the TrackObject, it doesn’t work, it seems to just skip through to the next audio file.