From ab5cf45d88e771d173f10023143388d35604ce00 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 6 Jun 2021 22:37:27 -0400 Subject: [PATCH] Fixed: Allow Blank Search #118 --- frontend/src/Search/SearchFooter.js | 2 +- src/Prowlarr.Api.V1/Search/SearchController.cs | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/frontend/src/Search/SearchFooter.js b/frontend/src/Search/SearchFooter.js index 90ce537cc..c36d8e5d9 100644 --- a/frontend/src/Search/SearchFooter.js +++ b/frontend/src/Search/SearchFooter.js @@ -39,7 +39,7 @@ class SearchFooter extends Component { searchQuery } = this.state; - if (searchQuery !== '' || searchCategories !== [] || searchIndexerIds !== []) { + if (searchQuery !== '' || searchCategories.length > 0 || searchIndexerIds.length > 0) { this.onSearchPress(); } diff --git a/src/Prowlarr.Api.V1/Search/SearchController.cs b/src/Prowlarr.Api.V1/Search/SearchController.cs index fff3bb3cc..651d28e87 100644 --- a/src/Prowlarr.Api.V1/Search/SearchController.cs +++ b/src/Prowlarr.Api.V1/Search/SearchController.cs @@ -78,19 +78,14 @@ namespace Prowlarr.Api.V1.Search [HttpGet] public Task> GetAll(string query, [FromQuery] List indexerIds, [FromQuery] List categories) { - if (query.IsNotNullOrWhiteSpace()) + if (indexerIds.Any()) { - if (indexerIds.Any()) - { - return GetSearchReleases(query, indexerIds, categories); - } - else - { - return GetSearchReleases(query, null, categories); - } + return GetSearchReleases(query, indexerIds, categories); + } + else + { + return GetSearchReleases(query, null, categories); } - - return Task.FromResult(new List()); } private async Task> GetSearchReleases(string query, List indexerIds, List categories)