fix(Search): Return search results even if there are ads (#373)

This commit is contained in:
absidue
2023-03-27 20:00:57 +02:00
committed by GitHub
parent ade5feb31c
commit 2c5907f80f

View File

@@ -30,7 +30,7 @@ class Search extends Feed<ISearchResponse> {
if (!contents)
throw new InnertubeError('No contents found in search response');
this.results = contents.firstOfType(ItemSection)?.contents;
this.results = contents.filterType(ItemSection).find((section) => section.contents && section.contents.length > 0)?.contents;
this.refinements = this.page.refinements || [];
this.estimated_results = this.page.estimated_results;