Missing from the Official Plugin Documentation

plugin-dev

#1

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.

 

Check it out here.

 

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.


#2

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.


#3

Nice work guys.....Highly appreciated.

Not sure if this fits the bill or not, since it's not api related, but more database related, but....

Any way....your call

https://forums.plexapp.com/index.php/topic/86694-sharing-info/?p=501898

/T


#4

Hi Dane

Not really applicable to channel development, but thanks.


#5

Not really applicable to channel development, but thanks.

Ack.....Maybe a second doc then?

After all, the more info we get collected into common repositories, the stronger both we and Plex stand.


#6

Ack.....Maybe a second doc then?

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.


#7

Done

Find it here:

https://forums.plexapp.com/index.php/topic/87348-undocumented-functionality-and-tips-tricks/?p=506039

Best regards

Tommy


#8

Additionally I cannot find anything within the official documents about: Resource.ContentsOfURLWithFallback

Perhaps a new entry for the "missing" document?


#9

It's already in there, there's a section called "Special handling for images"


#10

Hm, I really cannot find this section within the dev-center, wiki, pdf...


#11

Hm, I really cannot find this section within the dev-center, wiki, pdf...

Did you try the link in the first post?

https://docs.google.com/document/d/1MyhhTsg5xdDD5LRbOZ5x5QxkmEyXv6rB-22Z7tdpy34/edit

/T


#12

Hm works today... Don't know why but I couldn't open it yesterday... :/


#13

Cache Constants:

CACHE_1MINUTE
CACHE_1HOUR
CACHE_1DAY
CACHE_1WEEK
CACHE_1MONTH

If I'm not wrong it is not documented anywhere.


#14

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)

testPattern.search(testString).group(1)

#15

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 


#16

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.