diff --git a/src/NzbDrone.Core.Test/Files/Indexers/encoded_title.xml b/src/NzbDrone.Core.Test/Files/Indexers/encoded_title.xml new file mode 100644 index 000000000..c0144045d --- /dev/null +++ b/src/NzbDrone.Core.Test/Files/Indexers/encoded_title.xml @@ -0,0 +1,18 @@ + + + + + + + Series.&.Title.S02E19.EAC3.5.1.1080p.WEBRip.x265-iVy + https://my.indexer.com/info.php?guid=abc123 + https://my.indexer.com/api?t=get&id=abc123&apikey=secret + https://my.indexer.com/info.php?guid=abc123 + Fri, 20 Dec 2024 05:16:34 +0000 + TV > HD + Series.&.Title.S02E19.EAC3.5.1.1080p.WEBRip.x265-iVy + + + + + \ No newline at end of file diff --git a/src/NzbDrone.Core.Test/IndexerTests/BasicRssParserFixture.cs b/src/NzbDrone.Core.Test/IndexerTests/BasicRssParserFixture.cs index b2e171a58..bf4695826 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/BasicRssParserFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/BasicRssParserFixture.cs @@ -58,5 +58,16 @@ namespace NzbDrone.Core.Test.IndexerTests result.First().CommentUrl.Should().Be("http://my.indexer.com/details/123#comments"); result.First().DownloadUrl.Should().Be("http://my.indexer.com/getnzb/123.nzb&i=782&r=123"); } + + [Test] + public void should_decode_html_entities_in_item_title() + { + var xml = ReadAllText("Files/Indexers/encoded_title.xml"); + + var result = Subject.ParseResponse(CreateResponse("http://my.indexer.com/rss", xml)); + + result.Should().HaveCount(1); + result.First().Title.Should().Be("Series.&.Title.S02E19.EAC3.5.1.1080p.WEBRip.x265-iVy"); + } } } diff --git a/src/NzbDrone.Core.Test/Sonarr.Core.Test.csproj b/src/NzbDrone.Core.Test/Sonarr.Core.Test.csproj index 56177aa94..d968c2560 100644 --- a/src/NzbDrone.Core.Test/Sonarr.Core.Test.csproj +++ b/src/NzbDrone.Core.Test/Sonarr.Core.Test.csproj @@ -18,5 +18,8 @@ PreserveNewest + + PreserveNewest + diff --git a/src/NzbDrone.Core/Indexers/RssParser.cs b/src/NzbDrone.Core/Indexers/RssParser.cs index 4f4f5ce43..012ed823a 100644 --- a/src/NzbDrone.Core/Indexers/RssParser.cs +++ b/src/NzbDrone.Core/Indexers/RssParser.cs @@ -186,7 +186,9 @@ namespace NzbDrone.Core.Indexers protected virtual string GetTitle(XElement item) { - return item.TryGetValue("title", "Unknown"); + var title = item.TryGetValue("title", "Unknown"); + + return WebUtility.HtmlDecode(title); } protected virtual DateTime GetPublishDate(XElement item)