mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 18:57:39 -07:00
Fixed issue with nzbs.org search where title contained brackets
This commit is contained in:
parent
861026f743
commit
f2b091dcd2
3 changed files with 57 additions and 40 deletions
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.ServiceModel.Syndication;
|
||||
|
@ -159,8 +160,9 @@ namespace NzbDrone.Core.Test
|
|||
ExceptionVerification.IgnoreWarns();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void nzbsorg_search_returns_valid_results()
|
||||
[TestCase("simpsons", 21, 23)]
|
||||
[TestCase("Hawaii Five-0 (2010)", 1, 5)]
|
||||
public void nzbsorg_search_returns_valid_results(string title, int season, int episode)
|
||||
{
|
||||
var mocker = new AutoMoqer();
|
||||
|
||||
|
@ -174,16 +176,16 @@ namespace NzbDrone.Core.Test
|
|||
|
||||
mocker.Resolve<HttpProvider>();
|
||||
|
||||
var result = mocker.Resolve<NzbsOrg>().FetchEpisode("Simpsons", 21, 23);
|
||||
var result = mocker.Resolve<NzbsOrg>().FetchEpisode(title, season, episode);
|
||||
|
||||
result.Should().NotBeEmpty();
|
||||
result.Should().OnlyContain(r => r.CleanTitle == "simpsons");
|
||||
result.Should().OnlyContain(r => r.SeasonNumber == 21);
|
||||
result.Should().OnlyContain(r => r.EpisodeNumbers.Contains(23));
|
||||
result.Should().OnlyContain(r => r.CleanTitle == Parser.NormalizeTitle(title));
|
||||
result.Should().OnlyContain(r => r.SeasonNumber == season);
|
||||
result.Should().OnlyContain(r => r.EpisodeNumbers.Contains(episode));
|
||||
}
|
||||
|
||||
[TestCase("simpsons", 21, 23)]
|
||||
[TestCase("Hawaii Five-0 2010", 1, 5)]
|
||||
[TestCase("Hawaii Five-0 (2010)", 1, 5)]
|
||||
public void newzbin_search_returns_valid_results(string title, int season, int episode)
|
||||
{
|
||||
var mocker = new AutoMoqer();
|
||||
|
@ -275,5 +277,20 @@ namespace NzbDrone.Core.Test
|
|||
result.Should().OnlyContain(r => r.SeasonNumber == 1);
|
||||
result.Should().OnlyContain(r => r.EpisodeNumbers.Contains(19));
|
||||
}
|
||||
|
||||
|
||||
[TestCase("hawaii five-0 (2010)", "hawaii+five+0+2010")]
|
||||
[TestCase("this& that", "this+that")]
|
||||
[TestCase("this& that", "this+that")]
|
||||
public void get_query_title(string raw, string clean)
|
||||
{
|
||||
var result = IndexerBase.GetQueryTitle(raw);
|
||||
|
||||
result.Should().Be(clean);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue