Skip to content

Commit 946eb9b

Browse files
AudricVTheta-Dev
authored andcommitted
Add structure of channel tags
Tags' getters and/or setters have been added in ChannelExtractor and ChannelInfo to do so. Co-authored-by: ThetaDev <t.testboy@gmail.com>
1 parent 356a888 commit 946eb9b

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/channel/ChannelExtractor.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,8 @@ protected ChannelExtractor(final StreamingService service, final ListLinkHandler
4747
public abstract boolean isVerified() throws ParsingException;
4848
@Nonnull
4949
public abstract List<ListLinkHandler> getTabs() throws ParsingException;
50+
@Nonnull
51+
public List<String> getTags() throws ParsingException {
52+
return List.of();
53+
}
5054
}

extractor/src/main/java/org/schabi/newpipe/extractor/channel/ChannelInfo.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ public static ChannelInfo getInfo(final ChannelExtractor extractor)
123123
info.addError(e);
124124
}
125125

126+
try {
127+
info.setTags(extractor.getTags());
128+
} catch (final Exception e) {
129+
info.addError(e);
130+
}
131+
126132
return info;
127133
}
128134

@@ -136,8 +142,8 @@ public static ChannelInfo getInfo(final ChannelExtractor extractor)
136142
private String description;
137143
private String[] donationLinks;
138144
private boolean verified;
139-
140145
private List<ListLinkHandler> tabs = List.of();
146+
private List<String> tags = List.of();
141147

142148
public String getParentChannelName() {
143149
return parentChannelName;
@@ -227,4 +233,13 @@ public List<ListLinkHandler> getTabs() {
227233
public void setTabs(@Nonnull final List<ListLinkHandler> tabs) {
228234
this.tabs = tabs;
229235
}
236+
237+
@Nonnull
238+
public List<String> getTags() {
239+
return tags;
240+
}
241+
242+
public void setTags(@Nonnull final List<String> tags) {
243+
this.tags = tags;
244+
}
230245
}

0 commit comments

Comments
 (0)