Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Missing from the Official Plugin Documentation

mikedm139mikedm139 Plugin DeveloperMembers, Plex Pass, Plex Ninja Posts: 3,022 Plex Ninja

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.

Comments

  • GerkGerk Members, Plex Pass Posts: 1,052 Plex Pass

    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.

  • dane22dane22 Members, Plex Pass, Plex Ninja Posts: 9,866 Plex Ninja

    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

  • GerkGerk Members, Plex Pass Posts: 1,052 Plex Pass

    Hi Dane

    Not really applicable to channel development, but thanks.

  • dane22dane22 Members, Plex Pass, Plex Ninja Posts: 9,866 Plex Ninja
    Gerk wrote on November 24 2013, 8:45 PM: »

    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.

  • mikedm139mikedm139 Plugin Developer Members, Plex Pass, Plex Ninja Posts: 3,022 Plex Ninja

    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.
  • dane22dane22 Members, Plex Pass, Plex Ninja Posts: 9,866 Plex Ninja
  • realriotrealriot Members, Plex Pass Posts: 334 Plex Pass

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

    Perhaps a new entry for the "missing" document?

  • GerkGerk Members, Plex Pass Posts: 1,052 Plex Pass

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

  • realriotrealriot Members, Plex Pass Posts: 334 Plex Pass

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

  • dane22dane22 Members, Plex Pass, Plex Ninja Posts: 9,866 Plex Ninja
    realriot wrote on March 6 2014, 3:46 PM: »

    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

  • realriotrealriot Members, Plex Pass Posts: 334 Plex Pass

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

  • manfermanfer Members Posts: 87 ✭✭

    Cache Constants:

    CACHE_1MINUTE
    CACHE_1HOUR
    CACHE_1DAY
    CACHE_1WEEK
    CACHE_1MONTH

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

  • manfermanfer Members Posts: 87 ✭✭
    edited August 2015

    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)
    
  • mattrkmattrk Members, Plex Pass Posts: 94 Plex Pass

    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 

  • dmstvdmstv Members, Plex Pass Posts: 24 Plex Pass
    edited July 2015

    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.

Sign In or Register to comment.