diff --git a/NzbDrone.Core.Test/IndexerTests.cs b/NzbDrone.Core.Test/IndexerTests.cs index 0c74fe042..50ac36d16 100644 --- a/NzbDrone.Core.Test/IndexerTests.cs +++ b/NzbDrone.Core.Test/IndexerTests.cs @@ -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(); var result = mocker.Resolve().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(); var result = mocker.Resolve().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() + .SetupGet(c => c.NzbMatrixUsername) + .Returns(""); + + mocker.GetMock() + .SetupGet(c => c.NzbMatrixApiKey) + .Returns(""); + + mocker.Resolve(); + + var result = mocker.Resolve().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(); var result = mocker.Resolve().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() + .SetupGet(c => c.NzbMatrixUsername) + .Returns(""); + + mocker.GetMock() + .SetupGet(c => c.NzbMatrixApiKey) + .Returns(""); + + mocker.Resolve(); + + var result = mocker.Resolve().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)); + } } } diff --git a/NzbDrone.Core/Providers/Indexer/NzbMatrix.cs b/NzbDrone.Core/Providers/Indexer/NzbMatrix.cs index 72e5e1313..ed696518d 100644 --- a/NzbDrone.Core/Providers/Indexer/NzbMatrix.cs +++ b/NzbDrone.Core/Providers/Indexer/NzbMatrix.cs @@ -42,7 +42,14 @@ protected override string NzbDownloadUrl(SyndicationItem item) protected override IList GetSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber) { - return new List(); + var searchUrls = new List(); + + 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; } } diff --git a/NzbDrone.Core/Providers/MediaFileProvider.cs b/NzbDrone.Core/Providers/MediaFileProvider.cs index 250e2efc1..9b6237df4 100644 --- a/NzbDrone.Core/Providers/MediaFileProvider.cs +++ b/NzbDrone.Core/Providers/MediaFileProvider.cs @@ -194,7 +194,7 @@ public virtual Tuple 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(episodeTotal.Count, avilableEpisodes.Count()); + return new Tuple(avilableEpisodes.Count(), episodeTotal.Count); } private List GetMediaFileList(string path) diff --git a/NzbDrone.Web/Controllers/UpcomingController.cs b/NzbDrone.Web/Controllers/UpcomingController.cs index 3c9b4e826..17e5438bd 100644 --- a/NzbDrone.Web/Controllers/UpcomingController.cs +++ b/NzbDrone.Web/Controllers/UpcomingController.cs @@ -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, diff --git a/NzbDrone.Web/Models/UpcomingEpisodeModel.cs b/NzbDrone.Web/Models/UpcomingEpisodeModel.cs index 7138dff9f..9fc69921d 100644 --- a/NzbDrone.Web/Models/UpcomingEpisodeModel.cs +++ b/NzbDrone.Web/Models/UpcomingEpisodeModel.cs @@ -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; }