From fc6b45ee363fc871108054df67638f0392e395c9 Mon Sep 17 00:00:00 2001 From: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com> Date: Sat, 12 Mar 2022 13:06:00 +0100 Subject: [PATCH] Implement some methods in PlaylistExtractor This will prevent their override in each child class where the values corresponding to the methods could not be extracted. --- .../extractor/playlist/PlaylistExtractor.java | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/playlist/PlaylistExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/playlist/PlaylistExtractor.java index 683fcb62..f7866454 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/playlist/PlaylistExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/playlist/PlaylistExtractor.java @@ -8,15 +8,14 @@ import org.schabi.newpipe.extractor.stream.StreamInfoItem; import javax.annotation.Nonnull; +import static org.schabi.newpipe.extractor.utils.Utils.EMPTY_STRING; + public abstract class PlaylistExtractor extends ListExtractor { - public PlaylistExtractor(StreamingService service, ListLinkHandler linkHandler) { + public PlaylistExtractor(final StreamingService service, final ListLinkHandler linkHandler) { super(service, linkHandler); } - public abstract String getThumbnailUrl() throws ParsingException; - public abstract String getBannerUrl() throws ParsingException; - public abstract String getUploaderUrl() throws ParsingException; public abstract String getUploaderName() throws ParsingException; public abstract String getUploaderAvatarUrl() throws ParsingException; @@ -24,8 +23,30 @@ public abstract class PlaylistExtractor extends ListExtractor { public abstract long getStreamCount() throws ParsingException; - @Nonnull public abstract String getSubChannelName() throws ParsingException; - @Nonnull public abstract String getSubChannelUrl() throws ParsingException; - @Nonnull public abstract String getSubChannelAvatarUrl() throws ParsingException; + @Nonnull + public String getThumbnailUrl() throws ParsingException { + return EMPTY_STRING; + } + @Nonnull + public String getBannerUrl() throws ParsingException { + // Banner can't be handled by frontend right now. + // Whoever is willing to implement this should also implement it in the frontend. + return EMPTY_STRING; + } + + @Nonnull + public String getSubChannelName() throws ParsingException { + return EMPTY_STRING; + } + + @Nonnull + public String getSubChannelUrl() throws ParsingException { + return EMPTY_STRING; + } + + @Nonnull + public String getSubChannelAvatarUrl() throws ParsingException { + return EMPTY_STRING; + } }