EpisodeObject

Hi,

Sorry if this is a dumb question, but as I can’t seem to get to the API / dev documentation - does anyone have any info on the EpisodeObject (and really, the overall object hierarchy)? I’m really trying to figure out how to set viewOffset and lastViewedAt, to be able to start playback at a defined position.

Thanks!

Here are the things that are settable in the Framework for Episodes:

class Episode(MetadataRecord):
  title                     = Template.String()
  summary                   = Template.String()
  originally_available_at   = Template.Date()
  rating                    = Template.Float()
  duration                  = Template.Integer()
  content_rating            = Template.String()
  content_rating_age        = Template.Integer()
  writers                   = Template.Set(Template.String())
  directors                 = Template.Set(Template.String())
  producers                 = Template.Set(Template.String())
  guest_stars               = Template.Set(Template.String())
  thumbs                    = MediaProxyContainer()
  absolute_index            = Template.Integer()
  
  # Interface settings
  writers.xml_tag           = 'Writer'
  directors.xml_tag         = 'Director'
  producers.xml_tag         = 'Producer'
  guest_stars.xml_tag       = 'Role'

  xml_tag                   = 'Video'
  xml_attributes            =  dict(type = 'episode')
  
  key                       = Template.String()
  key.is_synthetic
  
  index                     = Template.Integer()
  index.is_synthetic
  
  show                      = Template.String()
  show.is_synthetic
  show.xml_attr_name        = 'grandparentTitle'
  
  season                    = Template.Integer()
  season.is_synthetic
  season.xml_attr_name      = 'parentIndex'
  
  thumbs.exclude_from_interface
  
  thumb                     = Template.String()
  thumb.is_synthetic
  
  art                       = Template.String()
  art.is_synthetic
  
  source_title              = Template.String()
  source_title.is_synthetic
  
  duration                  = Template.Integer()
  duration.is_synthetic
  
  tags                      = Template.Set(Template.String())
  tags.xml_tag              = 'Tag'
  
  rating_key                = Template.String()
  rating_key.is_synthetic

The Framework speaks metadata items only, however, and it’s in the server’s purview to set things like view offsets and last viewed. At the moment those are not supported at all for channel (plug-in) content, though that may be changing in the near future. Hope this helps.

@rkmorris said:
Sorry if this is a dumb question, but as I can’t seem to get to the API / dev documentation

Take a peak here:

forums.plex.tv/discussion/172923

/T

Makes sense, thanks for the quick replies!

Dang! I want the channel to be able to resume playback (from where it was stopped) - seems like that’s not possible right now. Hope it’s coming soon.

Thanks again.

Actually, one more thought on this … is it possible to read / update the Metadata? That would be a fix for what I’m after also.

Thanks!

OK, more digging / coding - I understand the answer above much better now (i.e. what is available in Episode), and also I got the following error message trying to set view_offset,

FrameworkException: The ‘view_offset’ attribute is inaccessible from model interfaces.

All makes complete sense. Hopefully as you say changes are coming, as it would be nice to be able to resume playback.

BTW, where did you get the details above from (for Episode)? I fear from the server source code, so it may not be available (for this or other objects) … :(.

Thanks!

@rkmorris said:
Dang! I want the channel to be able to resume playback (from where it was stopped) - seems like that’s not possible right now. Hope it’s coming soon.

I’m not 100% sure on this, but some channels resume playback of a video just fine. I have a feeling that this has to do with how the web server (where the video is streaming from) is configured.

@rkmorris said:
BTW, where did you get the details above from (for Episode)? I fear from the server source code, so it may not be available (for this or other objects) … :(.

That piece of code came from a file within the Framework bundle, which is part of the Plex Media Server. On Mac you can look inside the .app file and browse to Contents/Resources/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Models/Metadata/tv_models.pym I don’t know how to do this in Windows, sorry!

Hi,

Found this in Windows also, thanks for the pointer! Trying to find information now on Video Objects - I can’t seem to find this in the Framework, but I may just be missing it. Will keep digging.

Thanks again.

Hi,

Any more thoughts on this? I really would like to be able to sync Plex and NextPVR, but to do that Plex needs to make some of this interface available (like view_offset)?

Thanks!