Jump to content

api doesn't return accurate durations (or start times) of recordings


beeswax

Recommended Posts

I almost posted this over on the Kodi forum under the addon section but I think this is an api limitation.  If any recording is cut short, or stopped/resumed for some reason, the duration for said recording(s) get reported incorrectly by the api.  The api seems to assume all recordings ran their full course and just reports the length of the programme from the EPG e.g. "1h".  Example from a recording that was stopped by a sever reboot and then resumed:

 

api/recordings.html:

<recording id="4" charset="255" content="160" start="20180830100000" duration="010000">

 

rec_listnew.html?aktion=rec_listnew:

Thu 30/08/2018 10:00 (00:04)

 

The api is reporting 1 hour but the web interface correctly reports 4 minutes.  Both have the start time incorrect and just use the EPG start time, is that possible to fix as well?

support.zip

Edited by beeswax
Link to comment
5 hours ago, beeswax said:

The api is reporting 1 hour but the web interface correctly reports 4 minutes.  Both have the start time incorrect and just use the EPG start time, is that possible to fix as well?

 

No. /api/recordings.html was designed to report the start time and duration from the associated EPG data / EPG info file... don't ask me why, I don't know. Once an API is introduced it can't be changed  anymore for compatibility reasons. The only possibility is to extend it by adding new XML elements/attributes (e.g. "trueduration") or to create a new API, e.g. /api/recordings2.html.

 

Usually players retrieve the true duration by analyzing the file. Network clients can do it as well by reading the beginning and the end of a TS file and checking the time stamps.

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...