diff --git a/src/main/java/me/kavin/piped/utils/ResponseHelper.java b/src/main/java/me/kavin/piped/utils/ResponseHelper.java index 06b38fe..833b99f 100644 --- a/src/main/java/me/kavin/piped/utils/ResponseHelper.java +++ b/src/main/java/me/kavin/piped/utils/ResponseHelper.java @@ -407,8 +407,8 @@ public class ResponseHelper { Page nextpage = info.getNextPage(); - return Constants.mapper - .writeValueAsBytes(new SearchResults(items, Constants.mapper.writeValueAsString(nextpage))); + return Constants.mapper.writeValueAsBytes(new SearchResults(items, + Constants.mapper.writeValueAsString(nextpage), info.getSearchSuggestion(), info.isCorrectedSearch())); } diff --git a/src/main/java/me/kavin/piped/utils/obj/SearchResults.java b/src/main/java/me/kavin/piped/utils/obj/SearchResults.java index 718e639..72c2728 100644 --- a/src/main/java/me/kavin/piped/utils/obj/SearchResults.java +++ b/src/main/java/me/kavin/piped/utils/obj/SearchResults.java @@ -5,10 +5,18 @@ import it.unimi.dsi.fastutil.objects.ObjectArrayList; public class SearchResults { public ObjectArrayList items; - public String nextpage; + public String nextpage, suggestion; + public boolean corrected; public SearchResults(ObjectArrayList items, String nextpage) { this.nextpage = nextpage; this.items = items; } + + public SearchResults(ObjectArrayList items, String nextpage, String suggestion, boolean corrected) { + this.items = items; + this.nextpage = nextpage; + this.suggestion = suggestion; + this.corrected = corrected; + } }