mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-12-13 22:00:29 +05:30
Include search corrections in API.
This commit is contained in:
parent
2c7baa0710
commit
022a0af007
@ -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()));
|
||||
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,18 @@ import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
||||
public class SearchResults {
|
||||
|
||||
public ObjectArrayList<Object> items;
|
||||
public String nextpage;
|
||||
public String nextpage, suggestion;
|
||||
public boolean corrected;
|
||||
|
||||
public SearchResults(ObjectArrayList<Object> items, String nextpage) {
|
||||
this.nextpage = nextpage;
|
||||
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 New Issue
Block a user