# episode.duration not functioning properly

**URL:** <https://forums.plex.tv/t/episode-duration-not-functioning-properly/20308>\
**Category:** Dev/API Corner\
**Tags:** scanner-agent-dev\
**Created:** [August 21, 2012, 9:46pm UTC](https://forums.plex.tv/t/episode-duration-not-functioning-properly/20308 "2012-08-21T21:46:12Z")\
**Posts on this page:** 4\
**Page:** 1

<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:** [August 21, 2012, 9:46pm UTC](https://forums.plex.tv/t/episode-duration-not-functioning-properly/20308/1 "2012-08-21T21:46:12Z")

</div>

Hello everyone.  
  
  
  
I’m working on a metadata agent, and have pretty much everything working. However, I would like to explicitly define the length of tv show episodes, rather than Plex trying to figure it out from the file itself. I have seen several agents use episode.duration, but I cannot get this to work. When I define it and Log(episode.duration), it seems to have the information, but it is not being presented in Plex (the actual time is still displayed).   
  
  
  
Does anybody have any insight into episode.duration, and has anybody been able to get this to work?  
  
  
  
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 22, 2012, 12:12am UTC](https://forums.plex.tv/t/episode-duration-not-functioning-properly/20308/2 "2012-08-22T00:12:42Z")

</div>

Hi PartyMummy!  
  
The only thing I can think of right now is that maybe the value you’re trying to set is not accepted because it’s not an integer?

```auto

duration<br />
  An integer specifying the duration of the episode, in milliseconds.

```

---

<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:** [August 22, 2012, 1:27am UTC](https://forums.plex.tv/t/episode-duration-not-functioning-properly/20308/3 "2012-08-22T01:27:28Z")

</div>

Thanks for the reply. I have set it as an integer, but it still doesn’t respond. It works with metadata.duration (which also needs to be an integer), just not with episode.duration.

---

<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:** [December 20, 2019, 10:10pm UTC](https://forums.plex.tv/t/episode-duration-not-functioning-properly/20308/4 "2019-12-20T22:10:19Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
