Fix search result paging - due to the way as the InfoItemsSearchCollector are re-used,

the returned item list just grows, which cause that same videos are returned.
This commit is contained in:
Zsombor Gegesy 2019-11-21 23:03:14 +01:00
parent 0a3422a591
commit 2123b3abd3
3 changed files with 3 additions and 0 deletions

View File

@ -48,6 +48,7 @@ public class MediaCCCSearchExtractor extends SearchExtractor {
@Override
public InfoItemsPage<InfoItem> getInitialPage() throws IOException, ExtractionException {
InfoItemsSearchCollector searchItems = getInfoItemSearchCollector();
searchItems.reset();
if(getLinkHandler().getContentFilters().contains(CONFERENCES)
|| getLinkHandler().getContentFilters().contains(ALL)

View File

@ -76,6 +76,7 @@ public class SoundcloudSearchExtractor extends SearchExtractor {
private InfoItemsCollector<InfoItem, InfoItemExtractor> collectItems(JsonArray searchCollection) {
final InfoItemsSearchCollector collector = getInfoItemSearchCollector();
collector.reset();
for (Object result : searchCollection) {
if (!(result instanceof JsonObject)) continue;

View File

@ -106,6 +106,7 @@ public class YoutubeSearchExtractor extends SearchExtractor {
private InfoItemsSearchCollector collectItems(Document doc) throws NothingFoundException {
InfoItemsSearchCollector collector = getInfoItemSearchCollector();
collector.reset();
Element list = doc.select("ol[class=\"item-section\"]").first();
final TimeAgoParser timeAgoParser = getTimeAgoParser();