Sign up here and you can log into the forum!

UMSP Plugin Development

Discussion, features, plugins--everything about zoster's UMSP UPnP Media Server software

Re: UMSP Plugin Development   

Postby Jo2003 » Wed Oct 06, 2010 10:43 pm

I can post the whole code - no problem. The error doesn't come from my DOM stuff. The log says the error is here:

/usr/share/umsp/funcs-upnp.php

... and there I haven't changed anything.

--- link removed ---

If you want to try it out - "out of the box" it works in demo mode so you only have 4 tv channels. Cause of the problems stated above only favorites are working (this is where I only have one arg=val pair). Of course I forgot to test the "&" separator :oops: ... it looks like this could help.

Best regards,
Jo2003
Last edited by Jo2003 on Thu Oct 07, 2010 11:18 am, edited 1 time in total.
Jo2003
Developer
 
Posts: 32
Joined: Wed Jul 14, 2010 6:00 am
Location: Germany

Re: UMSP Plugin Development   

Postby zoster » Thu Oct 07, 2010 12:20 am

You should dump $requestRaw in control-reply.php. I bet it has either unencoded special characters or some XML fragment.
zoster
WDLXTV Team
 
Posts: 218
Joined: Wed Apr 14, 2010 10:14 am

Re: UMSP Plugin Development   

Postby Jo2003 » Thu Oct 07, 2010 11:09 am

As simple as I thought: Replace & with & when calling http_build_query to use with pseudo umsp url (umsp://).

So if you want to pass url like parameters to _pluginMain, use http_build_query this way:

Code: Select all
...
...

$params_for_main = array('action' => 'do_something', 'id' => 1234);
$url_like_params = http_build_query($params_for_main, "", "&");

$retMediaItems[] = array (
   'id'             => 'umsp://kartina/http-stream?".$url_like_params,
   'dc:title'       => 'Whatever',
   ...
   ...
);

...

return $retMediaItems;


Hope this helps if someone has the same problem.

Best regards,
Jo2003
Jo2003
Developer
 
Posts: 32
Joined: Wed Jul 14, 2010 6:00 am
Location: Germany

Re: UMSP Plugin Development   

Postby zoster » Thu Oct 07, 2010 11:22 am

That's still strange. http_build_query encodes the strings with hex values so "&" becomes "%26"
zoster
WDLXTV Team
 
Posts: 218
Joined: Wed Apr 14, 2010 10:14 am

Re: UMSP Plugin Development   

Postby Jo2003 » Thu Oct 07, 2010 10:28 pm

Not that strange. It concatenates the key-value pairs either using & (default) or using any other optional glue (& in our case).

e.g. you have an array as followed:
Code: Select all
$tmpArr = array('action' => 'load_archive',
                'url'    => 'umsp://kartina/http-stream?id=1234&anothervar=whatever',
                'gmt' => 123456789);


In fact http_build_query will convert every "&" in value belonging to key 'url' into hex value. But it will concatenate the key-value pairs using plaintext & (default) or using the optional glue.

So running: http_build_query($tmpArr) will create following query string:
Code: Select all
action=load_archive&url=umsp%3A%2F%2Fkartina%2Fhttp-stream%3Fid%3D1234%26anothervar%3Dwhatever&gmt=123456789


But running: http_build_query($tmpArr, "", "&") will create following query string:
Code: Select all
action=load_archive&url=umsp%3A%2F%2Fkartina%2Fhttp-stream%3Fid%3D1234%26anothervar%3Dwhatever&gmt=123456789


Best regards,
Jo2003
Jo2003
Developer
 
Posts: 32
Joined: Wed Jul 14, 2010 6:00 am
Location: Germany

Re: UMSP Plugin Development   

Postby zoster » Fri Oct 08, 2010 12:54 am

Yes, I know how http_build_query works ;) Still, if any ampersand should be encoded as & at this stage it's the one in the value. There's a possibility that the recent UTF-8 fix causes problems during _createDIDL or _createSOAP.
I'll look into it over the weekend.
zoster
WDLXTV Team
 
Posts: 218
Joined: Wed Apr 14, 2010 10:14 am

Re: UMSP Plugin Development   

Postby Jo2003 » Fri Oct 08, 2010 4:01 am

I haven't told that you don't know. ;) I only told where is the difference. I think this might be important for someone reading this thread.
Jo2003
Developer
 
Posts: 32
Joined: Wed Jul 14, 2010 6:00 am
Location: Germany

Re: UMSP Plugin Development   

Postby serge » Fri Dec 17, 2010 9:28 pm

Can any body write new radiotime.com plugin for UMSP for WDTV Live to play local internet radio station from any country use radiotime.com. Server better then shoutcast.com
I have in squezeebox almost any radio servers can play.
serge
n00b
 
Posts: 11
Joined: Fri Dec 10, 2010 10:56 pm

Re: UMSP Plugin Development   

Postby avkiev » Mon Apr 11, 2011 1:12 am

mad_ady wrote:but how about creating a new svn repository just for plugins under development? This would mean that most people wouldn't get them (since you need to make a manual selection under WEC) and people who opt in are always running the latest "bleeding edge" version.
Once most of the bugs have been ironed out, you can remove the plugin from the devel repo and add it to regular plugins (and during this time you still get the benefit of svn and cloud storage)

Good idea.
I've already thinking about it. We really need it
avkiev
Developer
 
Posts: 167
Joined: Tue Apr 27, 2010 5:02 am
Location: Ukraine, Kiev

Re: UMSP Plugin Development   

Postby mad_ady » Mon Apr 11, 2011 3:09 am

I have added the 'devel' folder, but currently it is not being picked up by the WEC in UMSPEXTRAREPOS.

It looks like the list of plugin sources is hardcoded in/var/www/addons/config/wdlxtv_options.php :

Code: Select all
$wec_options['UMSPEXTRAREPOS'] = array(
                    'configname' => 'UMSPEXTRAREPOS',
                    'configdesc' => 'Additional UMSP plugins sources',
                    'longdesc' => 'Select additional plugin repositories from<br>which you wish to download plugins.>',
                    'group' => '@UMSP Server',
                    'type' => WECT_MULTI,
                    'fieldheight' => '5',
                    'availval' => array('restricted-plugins','deutsch','espanol','russian'),
                    'availvalname' => array('Adult','German','Spanish','Russian'),



Can somebody with commit access to wdlxtv update the entry to allow also the devel repo? Hopefuly it will make it in the next 0.4.7.4, or at least on the ext3 version of the firmware.
User avatar
mad_ady
Developer
 
Posts: 4570
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

PreviousNext

Return to UMSP Media Server

Who is online

Users browsing this forum: No registered users and 3 guests