diff --git a/NzbDrone.Core.Test/JobTests/SeasonSearchJobTest.cs b/NzbDrone.Core.Test/JobTests/SeasonSearchJobTest.cs index bb5eae2e1..8ca03f86b 100644 --- a/NzbDrone.Core.Test/JobTests/SeasonSearchJobTest.cs +++ b/NzbDrone.Core.Test/JobTests/SeasonSearchJobTest.cs @@ -41,7 +41,7 @@ namespace NzbDrone.Core.Test.JobTests [Test] public void SeasonSearch_partial_season_success() { - var resultItems = Builder.CreateListOfSize(5) + var resultItems = Builder.CreateListOfSize(5) .All() .With(e => e.SearchError = ReportRejectionType.None) .With(e => e.Success = true) diff --git a/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessSearchResultsFixture.cs b/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessSearchResultsFixture.cs index 40c6022e4..145c8301a 100644 --- a/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessSearchResultsFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessSearchResultsFixture.cs @@ -106,7 +106,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests .Returns(ReportRejectionType.None); //Act - var result = Mocker.Resolve().ProcessSearchResults(new ProgressNotification("Test"), parseResults, new SearchResult(), _matchingSeries, 1, 1); + var result = Mocker.Resolve().ProcessSearchResults(new ProgressNotification("Test"), parseResults, new SearchHistory(), _matchingSeries, 1, 1); //Assert result.Should().HaveCount(parseResults.Count); @@ -139,7 +139,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests .Setup(s => s.IsSatisfiedBy(It.IsAny())).Returns(ReportRejectionType.None); //Act - var result = Mocker.Resolve().ProcessSearchResults(MockNotification, parseResults, new SearchResult(), _matchingSeries, 1, 1); + var result = Mocker.Resolve().ProcessSearchResults(MockNotification, parseResults, new SearchHistory(), _matchingSeries, 1, 1); //Assert result.Should().HaveCount(parseResults.Count); @@ -164,7 +164,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests WithQualityNotNeeded(); //Act - var result = Mocker.Resolve().ProcessSearchResults(new ProgressNotification("Test"), parseResults, new SearchResult(), _matchingSeries, 1, 1); + var result = Mocker.Resolve().ProcessSearchResults(new ProgressNotification("Test"), parseResults, new SearchHistory(), _matchingSeries, 1, 1); //Assert result.Should().HaveCount(parseResults.Count); @@ -188,7 +188,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests WithNullSeries(); //Act - var result = Mocker.Resolve().ProcessSearchResults(new ProgressNotification("Test"), parseResults, new SearchResult(), _matchingSeries, 1, 1); + var result = Mocker.Resolve().ProcessSearchResults(new ProgressNotification("Test"), parseResults, new SearchHistory(), _matchingSeries, 1, 1); //Assert result.Should().HaveCount(parseResults.Count); @@ -210,7 +210,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests WithMisMatchedSeries(); //Act - var result = Mocker.Resolve().ProcessSearchResults(new ProgressNotification("Test"), parseResults, new SearchResult(), _matchingSeries, 1, 1); + var result = Mocker.Resolve().ProcessSearchResults(new ProgressNotification("Test"), parseResults, new SearchHistory(), _matchingSeries, 1, 1); //Assert result.Should().HaveCount(parseResults.Count); @@ -232,7 +232,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests WithMatchingSeries(); //Act - var result = Mocker.Resolve().ProcessSearchResults(new ProgressNotification("Test"), parseResults, new SearchResult(), _matchingSeries, 1, 1); + var result = Mocker.Resolve().ProcessSearchResults(new ProgressNotification("Test"), parseResults, new SearchHistory(), _matchingSeries, 1, 1); //Assert result.Should().HaveCount(parseResults.Count); @@ -254,7 +254,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests WithMatchingSeries(); //Act - var result = Mocker.Resolve().ProcessSearchResults(new ProgressNotification("Test"), parseResults, new SearchResult(), _matchingSeries, 1, 1); + var result = Mocker.Resolve().ProcessSearchResults(new ProgressNotification("Test"), parseResults, new SearchHistory(), _matchingSeries, 1, 1); //Assert result.Should().HaveCount(parseResults.Count); @@ -281,7 +281,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests WithSuccessfulDownload(); //Act - var result = Mocker.Resolve().ProcessSearchResults(new ProgressNotification("Test"), parseResults, new SearchResult(), _matchingSeries, 1); + var result = Mocker.Resolve().ProcessSearchResults(new ProgressNotification("Test"), parseResults, new SearchHistory(), _matchingSeries, 1); //Assert result.Should().HaveCount(parseResults.Count); @@ -315,7 +315,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests .Returns(true); //Act - var result = Mocker.Resolve().ProcessSearchResults(new ProgressNotification("Test"), parseResults, new SearchResult(), _matchingSeries, 1); + var result = Mocker.Resolve().ProcessSearchResults(new ProgressNotification("Test"), parseResults, new SearchHistory(), _matchingSeries, 1); //Assert result.Should().HaveCount(parseResults.Count); diff --git a/NzbDrone.Core/Datastore/Migrations/Migration20120420.cs b/NzbDrone.Core/Datastore/Migrations/Migration20120420.cs index 688b3deaf..839d416f0 100644 --- a/NzbDrone.Core/Datastore/Migrations/Migration20120420.cs +++ b/NzbDrone.Core/Datastore/Migrations/Migration20120420.cs @@ -8,7 +8,7 @@ namespace NzbDrone.Core.Datastore.Migrations { protected override void MainDbUpgrade() { - Database.AddTable("SearchResults", new[] + Database.AddTable("SearchHistory", new[] { new Column("Id", DbType.Int32, ColumnProperty.PrimaryKeyWithIdentity), new Column("SeriesId", DbType.Int32, ColumnProperty.NotNull), @@ -18,10 +18,10 @@ namespace NzbDrone.Core.Datastore.Migrations new Column("SuccessfulDownload", DbType.Boolean, ColumnProperty.NotNull) }); - Database.AddTable("SearchResultItems", new[] + Database.AddTable("SearchHistoryItems", new[] { new Column("Id", DbType.Int32, ColumnProperty.PrimaryKeyWithIdentity), - new Column("SearchResultId", DbType.Int32, ColumnProperty.NotNull), + new Column("SearchHistoryId", DbType.Int32, ColumnProperty.NotNull), new Column("ReportTitle", DbType.String, ColumnProperty.NotNull), new Column("Indexer", DbType.String, ColumnProperty.NotNull), new Column("NzbUrl", DbType.String, ColumnProperty.NotNull), diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index bf01b1298..7d21a7066 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -277,7 +277,7 @@ - + @@ -305,8 +305,8 @@ Code - - + + diff --git a/NzbDrone.Core/Providers/SearchResultProvider.cs b/NzbDrone.Core/Providers/SearchHistoryProvider.cs similarity index 55% rename from NzbDrone.Core/Providers/SearchResultProvider.cs rename to NzbDrone.Core/Providers/SearchHistoryProvider.cs index edd48b266..3432cf273 100644 --- a/NzbDrone.Core/Providers/SearchResultProvider.cs +++ b/NzbDrone.Core/Providers/SearchHistoryProvider.cs @@ -10,7 +10,7 @@ using PetaPoco; namespace NzbDrone.Core.Providers { - public class SearchResultProvider + public class SearchHistoryProvider { private readonly IDatabase _database; private readonly SeriesProvider _seriesProvider; @@ -20,7 +20,7 @@ namespace NzbDrone.Core.Providers private static readonly Logger logger = LogManager.GetCurrentClassLogger(); [Inject] - public SearchResultProvider(IDatabase database, SeriesProvider seriesProvider, + public SearchHistoryProvider(IDatabase database, SeriesProvider seriesProvider, DownloadProvider downloadProvider, EpisodeProvider episodeProvider) { _database = database; @@ -29,80 +29,80 @@ namespace NzbDrone.Core.Providers _episodeProvider = episodeProvider; } - public SearchResultProvider() + public SearchHistoryProvider() { } - public virtual void Add(SearchResult searchResult) + public virtual void Add(SearchHistory searchResult) { logger.Trace("Adding new search result"); - searchResult.SuccessfulDownload = searchResult.SearchResultItems.Any(s => s.Success); + searchResult.SuccessfulDownload = searchResult.SearchHistoryItems.Any(s => s.Success); var id = Convert.ToInt32(_database.Insert(searchResult)); - searchResult.SearchResultItems.ForEach(s => s.SearchResultId = id); + searchResult.SearchHistoryItems.ForEach(s => s.SearchHistoryId = id); logger.Trace("Adding search result items"); - _database.InsertMany(searchResult.SearchResultItems); + _database.InsertMany(searchResult.SearchHistoryItems); } public virtual void Delete(int id) { logger.Trace("Deleting search result items attached to: {0}", id); - _database.Execute("DELETE FROM SearchResultItems WHERE SearchResultId = @0", id); + _database.Execute("DELETE FROM SearchHistoryItems WHERE SearchHistoryId = @0", id); logger.Trace("Deleting search result: {0}", id); - _database.Delete(id); + _database.Delete(id); } - public virtual List AllSearchResults() + public virtual List AllSearchHistory() { - var sql = @"SELECT SearchResults.Id, SearchResults.SeriesId, SearchResults.SeasonNumber, - SearchResults.EpisodeId, SearchResults.SearchTime, + var sql = @"SELECT SearchHistory.Id, SearchHistory.SeriesId, SearchHistory.SeasonNumber, + SearchHistory.EpisodeId, SearchHistory.SearchTime, Series.Title as SeriesTitle, Series.IsDaily, Episodes.EpisodeNumber, Episodes.SeasonNumber, Episodes.Title as EpisodeTitle, Episodes.AirDate, - Count(SearchResultItems.Id) as TotalItems, - SUM(CASE WHEN SearchResultItems.Success = 1 THEN 1 ELSE 0 END) as SuccessfulCount - FROM SearchResults + Count(SearchHistoryItems.Id) as TotalItems, + SUM(CASE WHEN SearchHistoryItems.Success = 1 THEN 1 ELSE 0 END) as SuccessfulCount + FROM SearchHistory INNER JOIN Series - ON Series.SeriesId = SearchResults.SeriesId + ON Series.SeriesId = SearchHistory.SeriesId LEFT JOIN Episodes - ON Episodes.EpisodeId = SearchResults.EpisodeId - INNER JOIN SearchResultItems - ON SearchResultItems.SearchResultId = SearchResults.Id - GROUP BY SearchResults.Id, SearchResults.SeriesId, SearchResults.SeasonNumber, - SearchResults.EpisodeId, SearchResults.SearchTime, + ON Episodes.EpisodeId = SearchHistory.EpisodeId + INNER JOIN SearchHistoryItems + ON SearchHistoryItems.SearchHistoryId = SearchHistory.Id + GROUP BY SearchHistory.Id, SearchHistory.SeriesId, SearchHistory.SeasonNumber, + SearchHistory.EpisodeId, SearchHistory.SearchTime, Series.Title, Series.IsDaily, Episodes.EpisodeNumber, Episodes.SeasonNumber, Episodes.Title, Episodes.AirDate"; - return _database.Fetch(sql); + return _database.Fetch(sql); } - public virtual SearchResult GetSearchResult(int id) + public virtual SearchHistory GetSearchHistory(int id) { - var sql = @"SELECT SearchResults.Id, SearchResults.SeriesId, SearchResults.SeasonNumber, - SearchResults.EpisodeId, SearchResults.SearchTime, + var sql = @"SELECT SearchHistory.Id, SearchHistory.SeriesId, SearchHistory.SeasonNumber, + SearchHistory.EpisodeId, SearchHistory.SearchTime, Series.Title as SeriesTitle, Series.IsDaily, Episodes.EpisodeNumber, Episodes.SeasonNumber, Episodes.Title as EpisodeTitle, Episodes.AirDate - FROM SearchResults + FROM SearchHistory INNER JOIN Series - ON Series.SeriesId = SearchResults.SeriesId + ON Series.SeriesId = SearchHistory.SeriesId LEFT JOIN Episodes - ON Episodes.EpisodeId = SearchResults.EpisodeId - WHERE SearchResults.Id = @0"; + ON Episodes.EpisodeId = SearchHistory.EpisodeId + WHERE SearchHistory.Id = @0"; - var result = _database.Single(sql, id); - result.SearchResultItems = _database.Fetch("WHERE SearchResultId = @0", id); + var result = _database.Single(sql, id); + result.SearchHistoryItems = _database.Fetch("WHERE SearchHistoryId = @0", id); return result; } public virtual void ForceDownload(int itemId) { - var item = _database.Single(itemId); - var searchResult = _database.Single(item.SearchResultId); + var item = _database.Single(itemId); + var searchResult = _database.Single(item.SearchHistoryId); var series = _seriesProvider.GetSeries(searchResult.SeriesId); var parseResult = Parser.ParseTitle(item.ReportTitle); diff --git a/NzbDrone.Core/Providers/SearchProvider.cs b/NzbDrone.Core/Providers/SearchProvider.cs index 1537657e7..036411ecd 100644 --- a/NzbDrone.Core/Providers/SearchProvider.cs +++ b/NzbDrone.Core/Providers/SearchProvider.cs @@ -22,7 +22,7 @@ namespace NzbDrone.Core.Providers private readonly SceneMappingProvider _sceneMappingProvider; private readonly UpgradePossibleSpecification _upgradePossibleSpecification; private readonly AllowedDownloadSpecification _allowedDownloadSpecification; - private readonly SearchResultProvider _searchResultProvider; + private readonly SearchHistoryProvider _searchHistoryProvider; private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); @@ -30,7 +30,7 @@ namespace NzbDrone.Core.Providers public SearchProvider(EpisodeProvider episodeProvider, DownloadProvider downloadProvider, SeriesProvider seriesProvider, IndexerProvider indexerProvider, SceneMappingProvider sceneMappingProvider, UpgradePossibleSpecification upgradePossibleSpecification, AllowedDownloadSpecification allowedDownloadSpecification, - SearchResultProvider searchResultProvider) + SearchHistoryProvider searchHistoryProvider) { _episodeProvider = episodeProvider; _downloadProvider = downloadProvider; @@ -39,7 +39,7 @@ namespace NzbDrone.Core.Providers _sceneMappingProvider = sceneMappingProvider; _upgradePossibleSpecification = upgradePossibleSpecification; _allowedDownloadSpecification = allowedDownloadSpecification; - _searchResultProvider = searchResultProvider; + _searchHistoryProvider = searchHistoryProvider; } public SearchProvider() @@ -48,7 +48,7 @@ namespace NzbDrone.Core.Providers public virtual bool SeasonSearch(ProgressNotification notification, int seriesId, int seasonNumber) { - var searchResult = new SearchResult + var searchResult = new SearchHistory { SearchTime = DateTime.Now, SeriesId = seriesId, @@ -91,15 +91,15 @@ namespace NzbDrone.Core.Providers e => e.EpisodeNumbers = episodeNumbers.ToList() ); - searchResult.SearchResultItems = ProcessSearchResults(notification, reports, searchResult, series, seasonNumber); - _searchResultProvider.Add(searchResult); + searchResult.SearchHistoryItems = ProcessSearchResults(notification, reports, searchResult, series, seasonNumber); + _searchHistoryProvider.Add(searchResult); return (searchResult.Successes.Count == episodeNumbers.Count); } public virtual List PartialSeasonSearch(ProgressNotification notification, int seriesId, int seasonNumber) { - var searchResult = new SearchResult + var searchResult = new SearchHistory { SearchTime = DateTime.Now, SeriesId = seriesId, @@ -127,9 +127,9 @@ namespace NzbDrone.Core.Providers return new List(); notification.CurrentMessage = "Processing search results"; - searchResult.SearchResultItems = ProcessSearchResults(notification, reports, searchResult, series, seasonNumber); + searchResult.SearchHistoryItems = ProcessSearchResults(notification, reports, searchResult, series, seasonNumber); - _searchResultProvider.Add(searchResult); + _searchHistoryProvider.Add(searchResult); return searchResult.Successes; } @@ -160,7 +160,7 @@ namespace NzbDrone.Core.Providers return false; } - var searchResult = new SearchResult + var searchResult = new SearchHistory { SearchTime = DateTime.Now, SeriesId = episode.Series.SeriesId @@ -173,20 +173,20 @@ namespace NzbDrone.Core.Providers if (episode.Series.IsDaily) { - searchResult.SearchResultItems = ProcessSearchResults(notification, reports, episode.Series, episode.AirDate.Value); - _searchResultProvider.Add(searchResult); + searchResult.SearchHistoryItems = ProcessSearchResults(notification, reports, episode.Series, episode.AirDate.Value); + _searchHistoryProvider.Add(searchResult); - if (searchResult.SearchResultItems.Any(r => r.Success)) + if (searchResult.SearchHistoryItems.Any(r => r.Success)) return true; } else { searchResult.EpisodeId = episodeId; - searchResult.SearchResultItems = ProcessSearchResults(notification, reports, searchResult, episode.Series, episode.SeasonNumber, episode.EpisodeNumber); - _searchResultProvider.Add(searchResult); + searchResult.SearchHistoryItems = ProcessSearchResults(notification, reports, searchResult, episode.Series, episode.SeasonNumber, episode.EpisodeNumber); + _searchHistoryProvider.Add(searchResult); - if (searchResult.SearchResultItems.Any(r => r.Success)) + if (searchResult.SearchHistoryItems.Any(r => r.Success)) return true; } @@ -257,10 +257,10 @@ namespace NzbDrone.Core.Providers return reports; } - public List ProcessSearchResults(ProgressNotification notification, IEnumerable reports, SearchResult searchResult, Series series, int seasonNumber, int? episodeNumber = null) + public List ProcessSearchResults(ProgressNotification notification, IEnumerable reports, SearchHistory searchResult, Series series, int seasonNumber, int? episodeNumber = null) { var successes = new List(); - var items = new List(); + var items = new List(); foreach (var episodeParseResult in reports.OrderByDescending(c => c.Quality).ThenBy(c => c.Age)) { @@ -268,7 +268,7 @@ namespace NzbDrone.Core.Providers { Logger.Trace("Analysing report " + episodeParseResult); - var item = new SearchResultItem + var item = new SearchHistoryItem { ReportTitle = episodeParseResult.OriginalString, NzbUrl = episodeParseResult.NzbUrl, @@ -353,16 +353,16 @@ namespace NzbDrone.Core.Providers return items; } - public List ProcessSearchResults(ProgressNotification notification, IEnumerable reports, Series series, DateTime airDate) + public List ProcessSearchResults(ProgressNotification notification, IEnumerable reports, Series series, DateTime airDate) { - var items = new List(); + var items = new List(); var skip = false; foreach (var episodeParseResult in reports.OrderByDescending(c => c.Quality)) { try { - var item = new SearchResultItem + var item = new SearchHistoryItem { ReportTitle = episodeParseResult.OriginalString, NzbUrl = episodeParseResult.NzbUrl, diff --git a/NzbDrone.Core/Repository/Search/SearchResult.cs b/NzbDrone.Core/Repository/Search/SearchHistory.cs similarity index 89% rename from NzbDrone.Core/Repository/Search/SearchResult.cs rename to NzbDrone.Core/Repository/Search/SearchHistory.cs index 1d5069940..ce4c831aa 100644 --- a/NzbDrone.Core/Repository/Search/SearchResult.cs +++ b/NzbDrone.Core/Repository/Search/SearchHistory.cs @@ -8,8 +8,8 @@ using PetaPoco; namespace NzbDrone.Core.Repository.Search { [PrimaryKey("Id", autoIncrement = true)] - [TableName("SearchResults")] - public class SearchResult + [TableName("SearchHistory")] + public class SearchHistory { public int Id { get; set; } public int SeriesId { get; set; } @@ -19,7 +19,7 @@ namespace NzbDrone.Core.Repository.Search public bool SuccessfulDownload { get; set; } [ResultColumn] - public List SearchResultItems { get; set; } + public List SearchHistoryItems { get; set; } [Ignore] public List Successes { get; set; } diff --git a/NzbDrone.Core/Repository/Search/SearchResultItem.cs b/NzbDrone.Core/Repository/Search/SearchHistoryItem.cs similarity index 88% rename from NzbDrone.Core/Repository/Search/SearchResultItem.cs rename to NzbDrone.Core/Repository/Search/SearchHistoryItem.cs index 091783319..41ad06665 100644 --- a/NzbDrone.Core/Repository/Search/SearchResultItem.cs +++ b/NzbDrone.Core/Repository/Search/SearchHistoryItem.cs @@ -8,11 +8,11 @@ using PetaPoco; namespace NzbDrone.Core.Repository.Search { [PrimaryKey("Id", autoIncrement = true)] - [TableName("SearchResultItems")] - public class SearchResultItem + [TableName("SearchHistoryItems")] + public class SearchHistoryItem { public int Id { get; set; } - public int SearchResultId { get; set; } + public int SearchHistoryId { get; set; } public string ReportTitle { get; set; } public string Indexer { get; set; } public string NzbUrl { get; set; } diff --git a/NzbDrone.Web/Controllers/SearchResultController.cs b/NzbDrone.Web/Controllers/SearchHistoryController.cs similarity index 77% rename from NzbDrone.Web/Controllers/SearchResultController.cs rename to NzbDrone.Web/Controllers/SearchHistoryController.cs index ea5867095..96c696e33 100644 --- a/NzbDrone.Web/Controllers/SearchResultController.cs +++ b/NzbDrone.Web/Controllers/SearchHistoryController.cs @@ -10,20 +10,20 @@ using NzbDrone.Web.Models; namespace NzbDrone.Web.Controllers { - public class SearchResultController : Controller + public class SearchHistoryController : Controller { - private readonly SearchResultProvider _searchResultProvider; + private readonly SearchHistoryProvider _searchHistoryProvider; - public SearchResultController(SearchResultProvider searchResultProvider) + public SearchHistoryController(SearchHistoryProvider searchHistoryProvider) { - _searchResultProvider = searchResultProvider; + _searchHistoryProvider = searchHistoryProvider; } public ActionResult Index() { - var results = _searchResultProvider.AllSearchResults(); + var results = _searchHistoryProvider.AllSearchHistory(); - var model = results.Select(s => new SearchResultsModel + var model = results.Select(s => new SearchHistoryModel { Id = s.Id, SearchTime = s.SearchTime.ToString(), @@ -37,13 +37,13 @@ namespace NzbDrone.Web.Controllers public ActionResult Details(int searchId) { - var searchResult = _searchResultProvider.GetSearchResult(searchId); + var searchResult = _searchHistoryProvider.GetSearchHistory(searchId); var model = new SearchDetailsModel { Id = searchResult.Id, DisplayName = GetDisplayName(searchResult), - SearchResultItems = - searchResult.SearchResultItems.Select(s => new SearchItemModel + SearchHistoryItems = + searchResult.SearchHistoryItems.Select(s => new SearchItemModel { Id = s.Id, ReportTitle = s.ReportTitle, @@ -66,12 +66,12 @@ namespace NzbDrone.Web.Controllers public JsonResult ForceDownload(int id) { - _searchResultProvider.ForceDownload(id); + _searchHistoryProvider.ForceDownload(id); return new JsonResult { Data = "ok", JsonRequestBehavior = JsonRequestBehavior.AllowGet }; } - public string GetDisplayName(SearchResult searchResult) + public string GetDisplayName(SearchHistory searchResult) { if (!searchResult.EpisodeNumber.HasValue) { diff --git a/NzbDrone.Web/Models/SearchDetailsModel.cs b/NzbDrone.Web/Models/SearchDetailsModel.cs index ce198cf59..e68a7762b 100644 --- a/NzbDrone.Web/Models/SearchDetailsModel.cs +++ b/NzbDrone.Web/Models/SearchDetailsModel.cs @@ -8,6 +8,6 @@ namespace NzbDrone.Web.Models { public int Id { get; set; } public string DisplayName { get; set; } - public List SearchResultItems { get; set; } + public List SearchHistoryItems { get; set; } } } \ No newline at end of file diff --git a/NzbDrone.Web/Models/SearchResultsModel.cs b/NzbDrone.Web/Models/SearchHistoryModel.cs similarity index 88% rename from NzbDrone.Web/Models/SearchResultsModel.cs rename to NzbDrone.Web/Models/SearchHistoryModel.cs index 178844c1f..d7cd78857 100644 --- a/NzbDrone.Web/Models/SearchResultsModel.cs +++ b/NzbDrone.Web/Models/SearchHistoryModel.cs @@ -2,7 +2,7 @@ namespace NzbDrone.Web.Models { - public class SearchResultsModel + public class SearchHistoryModel { public int Id { get; set; } public string DisplayName { get; set; } diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index 16dab8a16..2770e93d3 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -142,7 +142,7 @@ - + @@ -241,7 +241,7 @@ - + @@ -525,10 +525,10 @@ - + - + 10.0 diff --git a/NzbDrone.Web/Scripts/NzbDrone/Notification.js b/NzbDrone.Web/Scripts/NzbDrone/Notification.js index 0eaa53086..7cad8c155 100644 --- a/NzbDrone.Web/Scripts/NzbDrone/Notification.js +++ b/NzbDrone.Web/Scripts/NzbDrone/Notification.js @@ -34,7 +34,7 @@ jqXHR.error(function (xhr, textStatus, thrownError) { //ignore notification errors. - if (this.url.indexOf("/notification/Comet") === 0 || this.url.indexOf("/Health/Index") === 0) + if (this.url.indexOf("/notification/Comet") === 0 || this.url.indexOf("/Health/Index") === 0 || this.url.indexOf("/signalr") === 0) return; alert("Status: " + textStatus + ", Error: " + thrownError); diff --git a/NzbDrone.Web/Views/History/Index.cshtml b/NzbDrone.Web/Views/History/Index.cshtml index 2b7e46ae6..799a6a325 100644 --- a/NzbDrone.Web/Views/History/Index.cshtml +++ b/NzbDrone.Web/Views/History/Index.cshtml @@ -4,6 +4,7 @@ } diff --git a/NzbDrone.Web/Views/SearchResult/Details.cshtml b/NzbDrone.Web/Views/SearchHistory/Details.cshtml similarity index 86% rename from NzbDrone.Web/Views/SearchResult/Details.cshtml rename to NzbDrone.Web/Views/SearchHistory/Details.cshtml index 701b07804..0546caba1 100644 --- a/NzbDrone.Web/Views/SearchResult/Details.cshtml +++ b/NzbDrone.Web/Views/SearchHistory/Details.cshtml @@ -12,7 +12,7 @@ @section Scripts { - @(Html.GridScriptFor(m => m.SearchResultItems, "#searchDetailsGrid") + @(Html.GridScriptFor(m => m.SearchHistoryItems, "#searchDetailsGrid") .PageLength(20) .ChangePageLength(false) .AddColumn(new Column().Image("/Content/Images/Indexers/{Indexer}.png", new { alt = "{Indexer}", title = "{Indexer}" }, "{Indexer}").Sortable(false).Title("").Width("20px")) @@ -36,7 +36,7 @@ function actionColumn(source, type, val) { if (type === 'display' || type === 'filter') { - return 'Force'; + return 'Force'; } // 'sort' and 'type' both just use the raw data return ''; diff --git a/NzbDrone.Web/Views/SearchResult/Index.cshtml b/NzbDrone.Web/Views/SearchHistory/Index.cshtml similarity index 82% rename from NzbDrone.Web/Views/SearchResult/Index.cshtml rename to NzbDrone.Web/Views/SearchHistory/Index.cshtml index d28fc1b6f..e5b8556e3 100644 --- a/NzbDrone.Web/Views/SearchResult/Index.cshtml +++ b/NzbDrone.Web/Views/SearchHistory/Index.cshtml @@ -1,5 +1,5 @@ @using DataTables.Mvc.Core -@model IEnumerable +@model IEnumerable @{ ViewBag.Title = "Search Results"; @@ -13,7 +13,7 @@ Html.GridScriptForModel("#searchResultsGrid") .PageLength(20) .ChangePageLength(false) - .AddColumn(new Column().DataProperty("DisplayName").Link("SearchResult/Details?searchId={Id}", "{DisplayName}", null).Title("Name")) + .AddColumn(new Column().DataProperty("DisplayName").Link("SearchHistory/Details?searchId={Id}", "{DisplayName}", null).Title("Name")) .AddColumn(new Column().DataProperty("SearchTime").Title("Time").Width("170px")) .AddColumn(new Column().DataProperty("ReportCount").Title("Reports Found").Width("140px")) .AddColumn(new Column().DataProperty("Successful").Title("Successful").Width("110px"))