add outcomming items of searchextractor to searchinfo

This commit is contained in:
Christian Schabesberger 2018-07-08 19:53:07 +02:00
parent 4746a1c48a
commit 35b46900c1
2 changed files with 9 additions and 6 deletions

View File

@ -23,7 +23,7 @@ public class SearchInfo extends ListInfo<InfoItem> {
}
public static SearchInfo getInfo(SearchExtractor extractor) {
public static SearchInfo getInfo(SearchExtractor extractor) throws ExtractionException, IOException {
final SearchInfo info = new SearchInfo(
extractor.getServiceId(),
extractor.getUIHandler(),
@ -35,6 +35,9 @@ public class SearchInfo extends ListInfo<InfoItem> {
info.addError(e);
}
info.setRelatedItems(extractor.getInfoItemSearchCollector().getItems());
info.setNextPageUrl(extractor.getNextPageUrl());
return info;
}

View File

@ -153,22 +153,22 @@ public class YoutubePlaylistExtractorTest {
@Test
public void testName() throws Exception {
String name = extractor.getName();
assertTrue(name, name.contains("Important videos"));
assertTrue(name, name.contains("Korrekte Aussprache - Lektion 1"));
}
@Test
public void testId() throws Exception {
assertEquals("PLOy0j9AvlVZPto6IkjKfpu0Scx--7PGTC", extractor.getId());
assertEquals("PL45xb3ujEhqUexNt53jb9WT2mS-uUaUrn", extractor.getId());
}
@Test
public void testUrl() throws ParsingException {
assertEquals("https://www.youtube.com/playlist?list=PLOy0j9AvlVZPto6IkjKfpu0Scx--7PGTC", extractor.getUrl());
assertEquals("https://www.youtube.com/playlist?list=PL45xb3ujEhqUexNt53jb9WT2mS-uUaUrn", extractor.getUrl());
}
@Test
public void testOriginalUrl() throws ParsingException {
assertEquals("https://www.youtube.com/playlist?list=PLOy0j9AvlVZPto6IkjKfpu0Scx--7PGTC", extractor.getOriginalUrl());
assertEquals("https://www.youtube.com/watch?v=lH1caqoAGe0&list=PL45xb3ujEhqUexNt53jb9WT2mS-uUaUrn", extractor.getOriginalUrl());
}
/*//////////////////////////////////////////////////////////////////////////
@ -216,7 +216,7 @@ public class YoutubePlaylistExtractorTest {
@Test
public void testUploaderName() throws Exception {
assertEquals("Crazy Horse", extractor.getUploaderName());
assertEquals("Luksan Wunder", extractor.getUploaderName());
}
@Test