Skip to content

Commit

Permalink
add outcomming items of searchextractor to searchinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
theScrabi committed Jul 8, 2018
1 parent 4746a1c commit 35b4690
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public SearchInfo(int serviceId,
}


public static SearchInfo getInfo(SearchExtractor extractor) {
public static SearchInfo getInfo(SearchExtractor extractor) throws ExtractionException, IOException {
final SearchInfo info = new SearchInfo(
extractor.getServiceId(),
extractor.getUIHandler(),
Expand All @@ -35,6 +35,9 @@ public static SearchInfo getInfo(SearchExtractor extractor) {
info.addError(e);
}

info.setRelatedItems(extractor.getInfoItemSearchCollector().getItems());
info.setNextPageUrl(extractor.getNextPageUrl());

return info;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,22 +153,22 @@ public void testServiceId() {
@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());
}

/*//////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -216,7 +216,7 @@ public void testUploaderUrl() throws Exception {

@Test
public void testUploaderName() throws Exception {
assertEquals("Crazy Horse", extractor.getUploaderName());
assertEquals("Luksan Wunder", extractor.getUploaderName());
}

@Test
Expand Down

0 comments on commit 35b4690

Please sign in to comment.