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>
This commit is contained in:
AudricV 2023-06-29 17:41:01 +02:00 committed by Stypox
parent 356a888d6c
commit 946eb9bd91
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
2 changed files with 20 additions and 1 deletions

View File

@ -47,4 +47,8 @@ public abstract class ChannelExtractor extends Extractor {
public abstract boolean isVerified() throws ParsingException;
@Nonnull
public abstract List<ListLinkHandler> getTabs() throws ParsingException;
@Nonnull
public List<String> getTags() throws ParsingException {
return List.of();
}
}

View File

@ -123,6 +123,12 @@ public class ChannelInfo extends Info {
info.addError(e);
}
try {
info.setTags(extractor.getTags());
} catch (final Exception e) {
info.addError(e);
}
return info;
}
@ -136,8 +142,8 @@ public class ChannelInfo extends Info {
private String description;
private String[] donationLinks;
private boolean verified;
private List<ListLinkHandler> tabs = List.of();
private List<String> tags = List.of();
public String getParentChannelName() {
return parentChannelName;
@ -227,4 +233,13 @@ public class ChannelInfo extends Info {
public void setTabs(@Nonnull final List<ListLinkHandler> tabs) {
this.tabs = tabs;
}
@Nonnull
public List<String> getTags() {
return tags;
}
public void setTags(@Nonnull final List<String> tags) {
this.tags = tags;
}
}