1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-26 17:47:08 +00:00

Merge branch 'markus101'

This commit is contained in:
kay.one 2011-06-04 23:02:55 -07:00
commit fe5e899604
5 changed files with 56 additions and 10 deletions

View file

@ -117,7 +117,6 @@ public void custome_parser_partial_success(string title, int season, int episode
Assert.AreEqual(quality, result.Quality.QualityType);
}
[Test]
[TestCase("Adventure.Inc.DVDRip.XviD-OSiTV")]
public void custome_parser_full_parse(string title)
@ -143,8 +142,6 @@ public void custome_parser_full_parse(string title)
ExceptionVerification.ExcpectedWarns(1);
}
[Test]
public void downloadFeed()
{
@ -161,7 +158,6 @@ public void downloadFeed()
ExceptionVerification.IgnoreWarns();
}
[Test]
public void nzbsorg_search_returns_valid_results()
{
@ -175,7 +171,6 @@ public void nzbsorg_search_returns_valid_results()
.SetupGet(c => c.NzbsOrgHash)
.Returns("bc8edb4cc49d4ae440775adec5ac001f");
mocker.Resolve<HttpProvider>();
var result = mocker.Resolve<NzbsOrg>().FetchEpisode("Simpsons", 21, 23);
@ -186,7 +181,6 @@ public void nzbsorg_search_returns_valid_results()
result.Should().OnlyContain(r => r.EpisodeNumbers.Contains(23));
}
[Test]
public void newzbin_search_returns_valid_results()
{
@ -200,7 +194,6 @@ public void newzbin_search_returns_valid_results()
.SetupGet(c => c.NewzbinPassword)
.Returns("smartar39865");
mocker.Resolve<HttpProvider>();
var result = mocker.Resolve<Newzbin>().FetchEpisode("Simpsons", 21, 23);
@ -211,6 +204,28 @@ public void newzbin_search_returns_valid_results()
result.Should().OnlyContain(r => r.EpisodeNumbers.Contains(23));
}
[Test]
public void nzbmatrix_search_returns_valid_results()
{
var mocker = new AutoMoqer();
mocker.GetMock<ConfigProvider>()
.SetupGet(c => c.NzbMatrixUsername)
.Returns("");
mocker.GetMock<ConfigProvider>()
.SetupGet(c => c.NzbMatrixApiKey)
.Returns("");
mocker.Resolve<HttpProvider>();
var result = mocker.Resolve<NzbMatrix>().FetchEpisode("Simpsons", 21, 23);
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));
}
[Test]
public void nzbsorg_multi_word_search_returns_valid_results()
@ -225,7 +240,6 @@ public void nzbsorg_multi_word_search_returns_valid_results()
.SetupGet(c => c.NzbsOrgHash)
.Returns("bc8edb4cc49d4ae440775adec5ac001f");
mocker.Resolve<HttpProvider>();
var result = mocker.Resolve<NzbsOrg>().FetchEpisode("Blue Bloods", 1, 19);
@ -236,5 +250,28 @@ public void nzbsorg_multi_word_search_returns_valid_results()
result.Should().OnlyContain(r => r.EpisodeNumbers.Contains(19));
}
[Test]
public void nzbmatrix_multi_word_search_returns_valid_results()
{
var mocker = new AutoMoqer();
mocker.GetMock<ConfigProvider>()
.SetupGet(c => c.NzbMatrixUsername)
.Returns("");
mocker.GetMock<ConfigProvider>()
.SetupGet(c => c.NzbMatrixApiKey)
.Returns("");
mocker.Resolve<HttpProvider>();
var result = mocker.Resolve<NzbMatrix>().FetchEpisode("Blue Bloods", 1, 19);
result.Should().NotBeEmpty();
result.Should().OnlyContain(r => r.CleanTitle == "bluebloods");
result.Should().OnlyContain(r => r.SeasonNumber == 1);
result.Should().OnlyContain(r => r.EpisodeNumbers.Contains(19));
}
}
}

View file

@ -42,7 +42,14 @@ protected override string NzbDownloadUrl(SyndicationItem item)
protected override IList<string> GetSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
{
return new List<string>();
var searchUrls = new List<String>();
foreach (var url in Urls)
{
searchUrls.Add(String.Format("{0}&term={1}+s{2:00}e{3:00}", url, GetQueryTitle(seriesTitle), seasonNumber, episodeNumber));
}
return searchUrls;
}
}

View file

@ -194,7 +194,7 @@ public virtual Tuple<int, int> GetEpisodeFilesCount(int seriesId)
var episodeTotal = allEpisodes.Where(e => !e.Ignored && e.AirDate <= DateTime.Today && e.AirDate.Year > 1900).ToList();
var avilableEpisodes = episodeTotal.Where(e => e.EpisodeFileId > 0);
return new Tuple<int, int>(episodeTotal.Count, avilableEpisodes.Count());
return new Tuple<int, int>(avilableEpisodes.Count(), episodeTotal.Count);
}
private List<string> GetMediaFileList(string path)

View file

@ -30,6 +30,7 @@ public ActionResult _AjaxBindingYesterday()
var upcoming = _upcomingEpisodesProvider.Yesterday().Select(e => new UpcomingEpisodeModel
{
SeriesId = e.Series.SeriesId,
EpisodeId = e.EpisodeId,
SeriesName = e.Series.Title,
SeasonNumber = e.SeasonNumber,
EpisodeNumber = e.EpisodeNumber,

View file

@ -5,6 +5,7 @@ namespace NzbDrone.Web.Models
public class UpcomingEpisodeModel
{
public int SeriesId { get; set; }
public int EpisodeId { get; set; }
public string SeriesName { get; set; }
public int SeasonNumber { get; set; }
public int EpisodeNumber { get; set; }