diff --git a/NzbDrone.Core.Test/XbmcProviderTest.cs b/NzbDrone.Core.Test/XbmcProviderTest.cs
index 5b92c7247..8e17ac008 100644
--- a/NzbDrone.Core.Test/XbmcProviderTest.cs
+++ b/NzbDrone.Core.Test/XbmcProviderTest.cs
@@ -271,6 +271,39 @@ public void GetXbmcSeriesPath_false()
Assert.AreEqual("", result);
}
+ [Test]
+ public void GetXbmcSeriesPath_special_characters()
+ {
+ //Setup
+ var mocker = new AutoMoqer(MockBehavior.Strict);
+
+ var queryResult = @"smb://xbmc:xbmc@HOMESERVER/TV/Law & Order- Special Victims Unit/";
+
+ var host = "localhost:8080";
+ var username = "xbmc";
+ var password = "xbmc";
+
+ var setResponseUrl = "http://localhost:8080/xbmcCmds/xbmcHttp?command=SetResponseFormat(webheader;false;webfooter;false;header;;footer;;opentag;;closetag;;closefinaltag;false)";
+ var resetResponseUrl = "http://localhost:8080/xbmcCmds/xbmcHttp?command=SetResponseFormat()";
+ var query = String.Format("http://localhost:8080/xbmcCmds/xbmcHttp?command=QueryVideoDatabase(select path.strPath from path, tvshow, tvshowlinkpath where tvshow.c12 = 79488 and tvshowlinkpath.idShow = tvshow.idShow and tvshowlinkpath.idPath = path.idPath)");
+
+
+ //var fakeUdpProvider = mocker.GetMock();
+ var fakeHttp = mocker.GetMock();
+ fakeHttp.Setup(s => s.DownloadString(setResponseUrl, username, password)).Returns("OK");
+ fakeHttp.Setup(s => s.DownloadString(resetResponseUrl, username, password)).Returns(@"
+ OK
+ ");
+ fakeHttp.Setup(s => s.DownloadString(query, username, password)).Returns(queryResult);
+
+ //Act
+ var result = mocker.Resolve().GetXbmcSeriesPath(host, 79488, username, username);
+
+ //Assert
+ mocker.VerifyAllMocks();
+ result.Should().Be("smb://xbmc:xbmc@HOMESERVER/TV/Law & Order- Special Victims Unit/");
+ }
+
[Test]
public void Clean()
{
diff --git a/NzbDrone.Core/Providers/XbmcProvider.cs b/NzbDrone.Core/Providers/XbmcProvider.cs
index cc1b1a444..76de9579f 100644
--- a/NzbDrone.Core/Providers/XbmcProvider.cs
+++ b/NzbDrone.Core/Providers/XbmcProvider.cs
@@ -187,7 +187,7 @@ public virtual string GetXbmcSeriesPath(string host, int seriesId, string userna
if (String.IsNullOrEmpty(response))
return String.Empty;
- var xDoc = XDocument.Load(new StringReader(response));
+ var xDoc = XDocument.Load(new StringReader(response.Replace("&", "&")));
var xml = (from x in xDoc.Descendants("xml") select x).FirstOrDefault();
if (xml == null)