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