Include errors from child collectors in the search collector
This commit is contained in:
		
							parent
							
								
									2cf8cbf0df
								
							
						
					
					
						commit
						0c27198ba1
					
				
					 1 changed files with 22 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -11,6 +11,10 @@ import org.schabi.newpipe.extractor.playlist.PlaylistInfoItemsCollector;
 | 
			
		|||
import org.schabi.newpipe.extractor.stream.StreamInfoItemExtractor;
 | 
			
		||||
import org.schabi.newpipe.extractor.stream.StreamInfoItemsCollector;
 | 
			
		||||
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.Collections;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Created by Christian Schabesberger on 12.02.17.
 | 
			
		||||
 *
 | 
			
		||||
| 
						 | 
				
			
			@ -55,6 +59,24 @@ public class InfoItemsSearchCollector extends InfoItemsCollector<InfoItem, InfoI
 | 
			
		|||
        playlistCollector = new PlaylistInfoItemsCollector(serviceId);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<Throwable> getErrors() {
 | 
			
		||||
        final List<Throwable> errors = new ArrayList<>(super.getErrors());
 | 
			
		||||
        errors.addAll(streamCollector.getErrors());
 | 
			
		||||
        errors.addAll(userCollector.getErrors());
 | 
			
		||||
        errors.addAll(playlistCollector.getErrors());
 | 
			
		||||
 | 
			
		||||
        return Collections.unmodifiableList(errors);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void reset() {
 | 
			
		||||
        super.reset();
 | 
			
		||||
        streamCollector.reset();
 | 
			
		||||
        userCollector.reset();
 | 
			
		||||
        playlistCollector.reset();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public InfoItem extract(InfoItemExtractor extractor) throws ParsingException {
 | 
			
		||||
        // Use the corresponding collector for each item extractor type
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue