INTERACT FORUM
Windows => Third Party Plug-ins, Programs, and Skins => Topic started by: PaulSinnema on April 15, 2012, 01:14:17 am
-
Hi,
I'm expanding MC Remote with an artist and album list but got a bit of a problem. I use the /Library/Values url to get the artists like so:
http://speedy:52199/MCWS/v1/Library/Values?Field=Artist
This returns an XML with all the artist names:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <Response Status="OK">
<Item>16 Horsepower</Item>
<Item>A&HA</Item>
<Item>A.O.S.</Item>
To be able to display an image for the artist I retrieve the first song of this artist. As a test I changed the name 'A HA' to 'A&HA'. This will cause a url problem because the ampesand is used as webquery separator.
I've used the following code to Escape the ampesand
parameters.Add("Query", "[Artist]=" + Uri.EscapeDataString(artistName));
The result is:
http://Speedy:52199/MCWS/v1/Files/Search?Action=serialize&Query=[Artist]=A%26HA&Fields=Key&Zone=0&ZoneType=ID
where the ampesand is translated to '%26'. This however return all keys in the library which of course not is what I want.
I there a way to solve this problem?
Regards
Paul
-
The problem is even worse. Any spaces in artist names cause problems. The querystring does not allow strings in it. The escaped value is correct. I guess the Webservice simply does not do an unescape of the query string. Am I correct?
-
We were using recursive dehexification of the URL parameters, and this made it impossible to use a literal &.
Look for a fix next build.
-
Thanks Matt,
I can keep the escaping that I use now or do I need to do something else here?
Regards
Paul
-
We were using recursive dehexification of the URL parameters, and this made it impossible to use a literal &.
Look for a fix next build.
Hi Matt,
Take a look at this post please. I had made a mistake in the parameters routine and solved something. http://yabb.jriver.com/interact/index.php?topic=71697.msg484496#msg484496
Regards
Paul
-
Hi Matt,
No need to look any further. This also solves this problem.
Regards
Paul