VideoClipObject attributes

So from the current Plex documentation located here:

VideoClipObject has the same attributes as MovieObject.

So for my plugin I was wanting to add some more attributes like writers & directors but it seems the VideClipObject or the MovieObject for Channels does not support those. Is there a list of supported attributes for Channels somewhere ?

Thanks

There are some old documentation PDFs here:

You need the one named PlexPlug-inFramework.pdf

But the sure bet would be to look into the Plex Frameword sources directly. The available attributes can be seen in the *.pym files. The Framework sources location depends on the OS. On Windows *.pym can be found here:

c:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-???????\Framework.bundle\Contents\Resources\Versions\2\Models\Metadata\*.pym, where ??????? is a string that varies between PMS versions, there might also be more than one folder matching the pattern, you should be okay with any folder that you can find these files in, as they don’t seem to change significantly.

Thanks that was very helpful but I’m still missing some information to do this properly.

So based on the the *.pym files I realized that people are dict objects and not strings and so I add them in the following way:

...
genres_a = []
genres = data['genres']
for g in genres.split(','):
	genres_a.append(g.strip())
		
writers_a = []
writers = data['writers']
for w in writers.split(','):
	writers_a.append({'name': w.strip()})
		
directors_a = []
directors = data['directors']
for d in directors.split(','):
	directors_a.append({'name': d.strip()})

return VideoClipObject(
		title = title,
		url = furl,
		summary = summary,
		rating = rating,
		duration = duration,
		content_rating = content_rating,
		studio = studio,
		year = year,
		genres = genres_a,
		writers = writers_a,
		directors = directors_a,
		roles = roles_a,
		thumb = Resource.ContentsOfURLWithFallback(url = thumb, fallback='icon-cover.png')
	)		

But this still does not show up any writer or director. The following is the xml of the Movie.

<MediaContainer size="1" identifier="com.plexapp.system" mediaTagPrefix="/system/bundle/media/flags/" allowSync="1"> ---- snipped ---- <Genre tag="Animation"/> <Genre tag="Short"/> <Genre tag="Comedy"/> <Genre/> <Writer name="Sacha Goedegebure"/> <Writer name="Sacha Goedegebure"/> <Writer/> <Role/> <Role/> <Director name="Sacha Goedegebure"/> <Director/> </Video> </MediaContainer>

If I view the same on my mobile it shows the Writer and Director field but without a name.

Thanks for your time and help.

I’d guess it’s an issue with the client. You can’t fix it more in the channel code than getting the info to show up correctly in the XML. The only thing I could recommend is to try and get rid of empty Genre, Writer, Role,… tags, maybe they mess the client logic up…

Also, since the Plex Web is essentially a web page, you could poke around with the browser’s developer tools, maybe the info is there, but is just hidden due to a bug or any other reason.

May I ask how you get PMS to display the details page of the object? If return the object, e.g. MovieObject in an ObjectContainer then it displays it as a list or grid. If I do not use an ObjectContainer then I get nothing.

I am totally stuck. Thanks.

@czukowski said:
I’d guess it’s an issue with the client. You can’t fix it more in the channel code than getting the info to show up correctly in the XML. The only thing I could recommend is to try and get rid of empty Genre, Writer, Role,… tags, maybe they mess the client logic up…

Also, since the Plex Web is essentially a web page, you could poke around with the browser’s developer tools, maybe the info is there, but is just hidden due to a bug or any other reason.

So, I cleaned up the empty tags and still the director and writer fields dont shows up either on Plex-Web or Android client. I then went ahead and added the Big Buck Bunny movie to my library and the following is the xml for it which ofcourse shows all the metadata (writers, directors, etc.) on all clients.

<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="9" librarySectionTitle="Movies" librarySectionUUID="96c27e89-92b6-4ced-adea-cb3ac536043b" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1475587902">
---- snipped ----
<Genre id="2996" tag="Animation"/>
<Genre id="2997" tag="Comedy"/>
<Director id="2995" tag="Sacha Goedegebure"/>
<Producer id="2998" tag="Ton Roosendaal"/>
</MediaContainer>

I am wondering if this is just not supported by Channels. The xml for Movies has a tag attribute, however, when added by my Channel code above the fields have a name attribute instead. Is this a possible bug ? @sander1

I wonder what happens if you try something like this:

@route(PREFIX+'/test')
def Test():
    return DataObject("""<?xml version='1.0' encoding='utf-8'?>
<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="9" librarySectionTitle="Movies" librarySectionUUID="96c27e89-92b6-4ced-adea-cb3ac536043b" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1475587902">
---- snipped ----
<Genre id="2996" tag="Animation"/>
<Genre id="2997" tag="Comedy"/>
<Director id="2995" tag="Sacha Goedegebure"/>
<Producer id="2998" tag="Ton Roosendaal"/>
</MediaContainer>""", 'text/xml')

@czukowski said:
I wonder what happens if you try something like this:

@route(PREFIX+'/test')
def Test():

I am not sure if I follow you completely but I have just updated my Channel (/dev branch) with the code I referenced above here.
Can you give some more inputs on what you’d like me to test.

Thnx,
CA

I was just suggesting that you took the XML generated by your library, that makes Director/Producer/etc info show up, hardcoded that exactly same XML into your channel code, and then checked if that info starts showing up in the client as well. And if so, you could also try to modify that XML in different ways to try to understand what exactly makes it work. That is, if you’re interesting in that, because if the models won’t let you set the required attributes for it to work, this research would not have much practical use.

@czukowski said:
I’d guess it’s an issue with the client. You can’t fix it more in the channel code than getting the info to show up correctly in the XML.

That is correct. I’m pretty sure there aren’t any clients that use this metadata information from channels at the moment.

Thanks @czukowski and @sander1

As an exercise I did try and wrap my xml in a DataObject but it throws an error. Are there any examples out there to return metadata as an xml object. The only one I could find which is quite different is https://forums.plex.tv/discussion/57008/base64-image-as-thumbnail

@coder-alpha

I think DataObject is supposed to be used for returning any kind of “non-meta” data used by channels, such as thumbnail images it may generate. Not much practical sense in using it with XML when there’s a complex API for just that purpose is in place. And DataObject doesn’t seem to be a commonly used API either, so you’re unlikely to find many examples.

I have tried the similar piece of code from above, taken from my own library, and Plex Web did load the page, albeit still without the Director/Producer/etc tags. What kind of error is thrown and by whom (eg is it a Python error thrown by PMS or something else)?