Use setters in SearchInfo

This commit is contained in:
bopol 2020-04-12 15:27:51 +02:00
parent 29b639b454
commit 5d1c3b3fa2
2 changed files with 11 additions and 3 deletions

View File

@ -43,12 +43,12 @@ public class SearchInfo extends ListInfo<InfoItem> {
info.addError(e); info.addError(e);
} }
try { try {
info.searchSuggestion = extractor.getSearchSuggestion(); info.setSearchSuggestion(extractor.getSearchSuggestion());
} catch (Exception e) { } catch (Exception e) {
info.addError(e); info.addError(e);
} }
try { try {
info.isCorrectedSearch = extractor.isCorrectedSearch(); info.setCorrectedSearch(extractor.isCorrectedSearch());
} catch (Exception e) { } catch (Exception e) {
info.addError(e); info.addError(e);
} }
@ -80,4 +80,12 @@ public class SearchInfo extends ListInfo<InfoItem> {
public boolean isCorrectedSearch() { public boolean isCorrectedSearch() {
return this.isCorrectedSearch; return this.isCorrectedSearch;
} }
public void setCorrectedSearch(boolean correctedSearch) {
isCorrectedSearch = correctedSearch;
}
public void setSearchSuggestion(String searchSuggestion) {
this.searchSuggestion = searchSuggestion;
}
} }

View File

@ -143,7 +143,7 @@ public class YoutubeMusicSearchExtractor extends SearchExtractor {
return false; return false;
} }
JsonObject showingResultsForRenderer = itemSectionRenderer.getArray("contents").getObject(0) final JsonObject showingResultsForRenderer = itemSectionRenderer.getArray("contents").getObject(0)
.getObject("showingResultsForRenderer"); .getObject("showingResultsForRenderer");
return showingResultsForRenderer != null; return showingResultsForRenderer != null;
} }