Plugin Framework has changed and there is no documentation

I bet it was on last server update but not totally sure when this happened. The plugin framework has changed and there isn’t any source of documentation to know which are those changes. At least none that I could find.

I can’t figure out which is the new syntax for Metadata Objects.

What I can realize is that metadata like writers, producers, countries, … are no longer lists of strings.

directors = [ "Francis Ford Kubrik" ],

triggers error:

...
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-a17e99e\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\modelling\objects.py", line 225, in __init__
    setattr(self, name, model_attrs[name])
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-a17e99e\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\modelling\objects.py", line 295, in __setattr__
    setattr(record, key, item[key])
TypeError: string indices must be integers, not str

countries is still a list of strings. It is metadata directors, writers, producers, roles the ones that are not lists of strings anymore.

It must be now a list of Person objects but I don’t know the syntax.

I have tried:

directors = [
  {
    'role': "director",
    'name': "Francis Ford Kubrik"
  }
]

and there are no errors that way but the metadata is not populated to the frontend. So I suppose though a list of objects is correct, the syntax is not accurate.

After adding new attributes to the object I think my syntax is correct. So I suppose the problem is that the frontends are still not able to output that metadata on channel Media Objects.

So, directors, producers, writers and roles are now lists of Person objects and those objects can have as attributes, role, name and photo. But frontends can’t display the metadata. Example:

directors = [
  {
    'role': "director",
    'name': "Francis Ford Kubrik",
    'photo': "https://image.tmdb.org/t/p/original/iNuaYKoWb7psag7Tg3eRucj5sn2.jpg"
  },
  {
    'role': "director",
    'name': "Martin Lynch",
    'photo': "https://image.tmdb.org/t/p/original/AbmTtYTcIxpJSwAavjKpFKjPwia.jpg"
  }
]

Yes they did change some of the attributes in the latest version. And you are right the change affects directors, writers, producers, and cast. They wanted the ability to add images for these attributes in the metadata agents, but the change affects channels use of these attributes too.

See github.com/haeY/OpenMovieDatabase.bundle/blob/master/Contents/Code/init.py#L104 for examples of the new syntax. But those examples are adding it for agents, so to add these new attributes in a channel plugin, you will have to create an object variable first. I was shown this as an example:

movieObjVar = MovieObject(title=title[0], …) for director in xml.xpath('//i/@dr')[0].split(','): new_director = movieObjVar.director.new()

Since these attributes are used in a few URL services in the Services.bundle (Vimeo, Crackle and TouTV), for now the attributes were just removed, so those URL services would work again. (Since the Services.bundle can be updated again)

Someone much smarter than me is looking into the new methods for these attributes and the best way to create the object variable to include them in those existing URL service. So once they have it figured out and there is a working example, we will know more about how to implement this change for channels. And we will know how to update the “Missing Documentation” file to include these changes.

So… am I understanding that there is no current documentation for channel developers? Are devs just supposed to guess at new syntax until official plugins are released that use the new features? I’m completely confused as to what is going on here.

As far as overall documentation, you can refer to the Framework Documentation PDF and the Missing from the Official Plugin Documentation for any updates or changes to the Framework Documentation.

And understand that I am a channel developer too and just relaying information (so do not shoot the messenger). And the Missing from the Official Plugin Documentation was created and is updated by a few channel developers, so all of us can keep up with changes Plex may make to the Channel Dev API.

That person that is “smarter than me” that I mentioned above was not able to get that object variable method to work with channels. So, the Plex guys who write the API said they are going to update Plex, so those attributes will work again with channels.

For now, the directors, writers, producers, and cast attributes will not work and should be removed from any Plex channel, but hopefully it will work in the next PMS release.