Usage of XBMC->WriteFile in PVR Addon
#1
Hi,

I'm developing a DVBLink Server PVR Addon for XBMC. The DVBLink API uses http post, which makes it a bit difficult to work with in relation to XBMC. I know I can't use Libcurl and was thus trying out the XBMC (CHelper_libXBMC_addon) methods OpenFileForWrite/WriteFile. They seemed to work in that they infact is using http post and request are getting to the server, but server don't return what was expected (xml data).

After some investigation I found out that when used on http they use the CHTTPFile::Write method. In this method I can see that the mime type is forced to be "application/json". Is this a bug or intentional ? I know it is likely because it in the past has only been used with json call, but would it be possible to make it a more general solution ?

Just to see what happend I tried to change it to general http post content type "application/x-www-form-urlencoded", and guess what it worked Smile But it just puts even more emphasis on my question Smile

/Zeroniak
Reply
#2
it's not a bug nor intentional - well, a bit intentional. Thing is, after the removal of curl for PVR addons there was no way to do post calls, which where required by the 4TheRecord addon. RedF then took the time to find a quick and clean fix for it and created the post abstraction you currently see. Long term plans (AFAIK) are to make the mime time configurable, but there was no immediate solution for this and feature freeze for Frodo was to close to wait any longer. So fixing it was postponed for after Frodo. But if you have an idea on how to make the mime type configurable in a nice and clean way, go ahead and add a PR for it, and with luck our release manager might let it in for Frodo (no guarantee)
Reply
#3
I have made a temporary work around in my addon, as I did not feel enough into the inner workings xbmc and what other code relied on the method to know if I would break any thing..
And since it would likely not get into Frodo any way, I decided I would look at it later and instead focus on getting my addon working.
Reply
#4
it'll need api changes to set the mime type, and it's too late for that now. something for frodo+1
opdenkamp / dushmaniac

xbmc-pvr [Eden-PVR builds] [now included in mainline XBMC, so no more source link here :)]
personal website: [link]

Found a problem with PVR? Report it on Trac, under "PVR - core components". Please attach the full debug log.

If you like my work, please consider donating to me and/or Team XBMC.
Reply
#5
I came to the same conclusion, which was why I wrote a temporary workaround (using sockets) in my add-on Smile But will try to make a modification to XBMC when Frodo is released.
Reply

Logout Mark Read Team Forum Stats Members Help
Usage of XBMC->WriteFile in PVR Addon0