Jump to content

Api calls and return values


DetlefM

Recommended Posts

I noticed several things during my tests that make debugging api calls difficult.

/api/epg.html
The returned XML string is often (but not always) incorrect if the EPG entry is not found.
<?xml version="1.0" encoding="utf-8" ?><!-- by DVBViewer Media Server --><epg Ver="1">
The end tag is missing.
Here it would be nice (besides the return of a valid XML string) to get an error code included. For example: wrong channelid, epgid not found
When searching for pdc with a wrong pdc value (in my case 'NOPDC') this filter is completely ignored and the EPG list of the channel is returned. I think also here an error message would be more helpful.

Many other api calls have no return value at all - e.g. timeredit. Here it would be helpful if the changed timer (or an error code in case of problems) would be returned.

Link to comment
7 hours ago, DetlefM said:

The returned XML string is often (but not always) incorrect if the EPG entry is not found.
<?xml version="1.0" encoding="utf-8" ?><!-- by DVBViewer Media Server --><epg Ver="1">
The end tag is missing.

 

Firefox displays a xml file containing

 

<?xml version="1.0" encoding="utf-8" ?><!-- by DVBViewer Media Server --><epg Ver="1">

 

without complaining about an error, though Firefox is quite picky in this respect.


Anyway, an end tag is supposed to be present, and after looking at the code, the only reason for an omitted end tag I can think of is an exception (access violation etc). while collecting matching EPG entries. The Media Server catches such an exception, but does not log it, so it does not appear in the svcdebug.log. It's that old rule: No matter how much logging is added, you never get what you need. ;)

 

Investigating this will require a test version with additional logging.

 

7 hours ago, DetlefM said:

I think also here an error message would be more helpful. Many other api calls have no return value at all

 

I know, but currently I'm not able to look deeper into this matter, because I'm busy with another topic.

 

When I inherited about 1.000.000 lines of undocumented and quite chaotic DVBViewer Pro and Media Server code in 2013, originating from a very creative "rapid prototyping" period, I knew that it would take years to get everything fixed. But I was wrong. It will take decades... provided I live that long.

 

  • Thanks 1
Link to comment

 

15 hours ago, Griga said:

Firefox displays a xml file containing

 

<?xml version="1.0" encoding="utf-8" ?><!-- by DVBViewer Media Server --><epg Ver="1">

 

without complaining about an error, though Firefox is quite picky in this respect.

 

I use  c# 

using System.XML.Linq
XDocument doc = XDocument.Parse(xmlString);

and this throws an Exception. But, yes, I can test it in advance.

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