# EpisodeObject

**URL:** <https://forums.plex.tv/t/episodeobject/112753>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [August 22, 2015, 3:27am UTC](https://forums.plex.tv/t/episodeobject/112753 "2015-08-22T03:27:50Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmorris](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/rmorris/32/13669_2.png) [@rmorris](https://forums.plex.tv/u/rmorris)\
**Post date:** [August 22, 2015, 3:27am UTC](https://forums.plex.tv/t/episodeobject/112753/1 "2015-08-22T03:27:50Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![mmccurdy](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mmccurdy/32/83290_2.png) [@mmccurdy](https://forums.plex.tv/u/mmccurdy)\
**Post date:** [August 22, 2015, 9:10am UTC](https://forums.plex.tv/t/episodeobject/112753/2 "2015-08-22T09:10:20Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [August 22, 2015, 10:22am UTC](https://forums.plex.tv/t/episodeobject/112753/3 "2015-08-22T10:22:36Z")

</div>

> @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](https://forums.plex.tv/discussion/172923 "https://forums.plex.tv/discussion/172923")

/T

---

<div class="post-metadata">

**Author:** ![rmorris](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/rmorris/32/13669_2.png) [@rmorris](https://forums.plex.tv/u/rmorris)\
**Post date:** [August 22, 2015, 12:04pm UTC](https://forums.plex.tv/t/episodeobject/112753/4 "2015-08-22T12:04:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rmorris](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/rmorris/32/13669_2.png) [@rmorris](https://forums.plex.tv/u/rmorris)\
**Post date:** [August 22, 2015, 5:28pm UTC](https://forums.plex.tv/t/episodeobject/112753/5 "2015-08-22T17:28:48Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![rmorris](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/rmorris/32/13669_2.png) [@rmorris](https://forums.plex.tv/u/rmorris)\
**Post date:** [August 23, 2015, 3:01am UTC](https://forums.plex.tv/t/episodeobject/112753/6 "2015-08-23T03:01:06Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![sander1](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@sander1](https://forums.plex.tv/u/sander1)\
**Post date:** [August 24, 2015, 11:00am UTC](https://forums.plex.tv/t/episodeobject/112753/7 "2015-08-24T11:00:55Z")

</div>

> @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!

---

<div class="post-metadata">

**Author:** ![rmorris](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/rmorris/32/13669_2.png) [@rmorris](https://forums.plex.tv/u/rmorris)\
**Post date:** [August 24, 2015, 2:50pm UTC](https://forums.plex.tv/t/episodeobject/112753/8 "2015-08-24T14:50:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rmorris](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/rmorris/32/13669_2.png) [@rmorris](https://forums.plex.tv/u/rmorris)\
**Post date:** [September 26, 2015, 8:14pm UTC](https://forums.plex.tv/t/episodeobject/112753/9 "2015-09-26T20:14:40Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [January 8, 2020, 7:50pm UTC](https://forums.plex.tv/t/episodeobject/112753/10 "2020-01-08T19:50:45Z")

</div>


