mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Include search corrections in API.
This commit is contained in:
parent
2c7baa0710
commit
022a0af007
2 changed files with 11 additions and 3 deletions
|
@ -407,8 +407,8 @@ public class ResponseHelper {
|
||||||
|
|
||||||
Page nextpage = info.getNextPage();
|
Page nextpage = info.getNextPage();
|
||||||
|
|
||||||
return Constants.mapper
|
return Constants.mapper.writeValueAsBytes(new SearchResults(items,
|
||||||
.writeValueAsBytes(new SearchResults(items, Constants.mapper.writeValueAsString(nextpage)));
|
Constants.mapper.writeValueAsString(nextpage), info.getSearchSuggestion(), info.isCorrectedSearch()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,18 @@ import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
||||||
public class SearchResults {
|
public class SearchResults {
|
||||||
|
|
||||||
public ObjectArrayList<Object> items;
|
public ObjectArrayList<Object> items;
|
||||||
public String nextpage;
|
public String nextpage, suggestion;
|
||||||
|
public boolean corrected;
|
||||||
|
|
||||||
public SearchResults(ObjectArrayList<Object> items, String nextpage) {
|
public SearchResults(ObjectArrayList<Object> items, String nextpage) {
|
||||||
this.nextpage = nextpage;
|
this.nextpage = nextpage;
|
||||||
this.items = items;
|
this.items = items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SearchResults(ObjectArrayList<Object> items, String nextpage, String suggestion, boolean corrected) {
|
||||||
|
this.items = items;
|
||||||
|
this.nextpage = nextpage;
|
||||||
|
this.suggestion = suggestion;
|
||||||
|
this.corrected = corrected;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue