Skip to content

Commit 29c868e

Browse files
committed
add: RenderListInfoItem
1 parent cf6504c commit 29c868e

3 files changed

Lines changed: 123 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package org.schabi.newpipe.extractor.channel.tabs.rendererlist;
2+
3+
import org.schabi.newpipe.extractor.InfoItem;
4+
5+
public class RendererListInfoItem extends InfoItem {
6+
7+
private String title;
8+
private int parentListIndex;
9+
10+
private String rendererListItemType;
11+
12+
public RendererListInfoItem(final int serviceId, final String url, final String name) {
13+
super(InfoType.RENDERERLIST, serviceId, url, name);
14+
}
15+
16+
public String getTitle() {
17+
return this.title;
18+
}
19+
20+
public void setTitle(final String title) {
21+
this.title = title;
22+
}
23+
24+
public int getParentListIndex() {
25+
return parentListIndex;
26+
}
27+
28+
public void setParentListIndex(final int parentListIndex) {
29+
this.parentListIndex = parentListIndex;
30+
}
31+
32+
public String getRendererListItemType() {
33+
return this.rendererListItemType;
34+
}
35+
36+
public void setRendererListItemType(final String rendererListItemType) {
37+
this.rendererListItemType = rendererListItemType;
38+
}
39+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package org.schabi.newpipe.extractor.channel.tabs.rendererlist;
2+
3+
import org.schabi.newpipe.extractor.InfoItemExtractor;
4+
import org.schabi.newpipe.extractor.exceptions.ParsingException;
5+
6+
public interface RendererListInfoItemExtractor extends InfoItemExtractor {
7+
8+
/**
9+
* Get the index of the parent list
10+
* @return the index of the parent list
11+
*/
12+
int getParentListIndex() throws ParsingException;
13+
14+
/**
15+
* Get the item type that exist in the renderer list
16+
* @return the item type of the render list
17+
*/
18+
String getRendererListItemType() throws ParsingException;
19+
20+
/**
21+
* Get the uploader including tab url
22+
* @return the uploader including tab url
23+
*/
24+
String getUploaderTabUrl() throws ParsingException;
25+
26+
/**
27+
* Get the uploader name
28+
* @return the uploader name
29+
*/
30+
String getUploaderName() throws ParsingException;
31+
32+
/**
33+
* Get the uploader url
34+
* @return the uploader url
35+
*/
36+
String getUploaderUrl() throws ParsingException;
37+
38+
/**
39+
* Get whether the uploader is verified
40+
* @return whether the uploader is verified
41+
*/
42+
boolean isUploaderVerified() throws ParsingException;
43+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package org.schabi.newpipe.extractor.channel.tabs.rendererlist;
2+
3+
import org.schabi.newpipe.extractor.InfoItemsCollector;
4+
import org.schabi.newpipe.extractor.exceptions.ParsingException;
5+
6+
public final class RendererListInfoItemsCollector extends
7+
InfoItemsCollector<RendererListInfoItem, RendererListInfoItemExtractor> {
8+
9+
public RendererListInfoItemsCollector(final int serviceId) {
10+
super(serviceId);
11+
}
12+
13+
@Override
14+
public RendererListInfoItem extract(final RendererListInfoItemExtractor extractor)
15+
throws ParsingException {
16+
17+
final RendererListInfoItem resultItem = new RendererListInfoItem(
18+
getServiceId(), extractor.getUrl(), extractor.getName());
19+
20+
try {
21+
resultItem.setTitle(extractor.getName());
22+
} catch (final Exception e) {
23+
addError(e);
24+
}
25+
try {
26+
resultItem.setParentListIndex(extractor.getParentListIndex());
27+
} catch (final Exception e) {
28+
addError(e);
29+
}
30+
try {
31+
resultItem.setRendererListItemType(extractor.getRendererListItemType());
32+
} catch (final Exception e) {
33+
addError(e);
34+
}
35+
36+
37+
return resultItem;
38+
}
39+
}
40+
41+

0 commit comments

Comments
 (0)