diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamExtractor.java index 4a7ef400..8eeb1b49 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamExtractor.java @@ -337,6 +337,22 @@ public abstract class StreamExtractor extends Extractor { public abstract InfoItemsCollector getRelatedItems() throws IOException, ExtractionException; + /** + * @deprecated Use {@link #getRelatedItems()}. May be removed in a future version. + * @return The result of {@link #getRelatedItems()} if it is a + * StreamInfoItemsCollector, null otherwise + * @throws IOException + * @throws ExtractionException + */ + @Deprecated + @Nullable + public StreamInfoItemsCollector getRelatedStreams() throws IOException, ExtractionException { + InfoItemsCollector collector = getRelatedItems(); + if (collector instanceof StreamInfoItemsCollector) { + return (StreamInfoItemsCollector) collector; + } else return null; + } + /** * Should return a list of Frameset object that contains preview of stream frames * diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java index 88d01fa0..cfd118bc 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java @@ -606,10 +606,26 @@ public class StreamInfo extends Info { return relatedItems; } + /** + * @deprecated Use {@link #getRelatedItems()} + */ + @Deprecated + public List getRelatedStreams() { + return getRelatedItems(); + } + public void setRelatedItems(List relatedItems) { this.relatedItems = relatedItems; } + /** + * @deprecated Use {@link #setRelatedItems(List)} + */ + @Deprecated + public void setRelatedStreams(List relatedItems) { + setRelatedItems(relatedItems); + } + public long getStartPosition() { return startPosition; } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/utils/ExtractorHelper.java b/extractor/src/main/java/org/schabi/newpipe/extractor/utils/ExtractorHelper.java index 07682762..3a74c2d3 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/utils/ExtractorHelper.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/utils/ExtractorHelper.java @@ -41,4 +41,12 @@ public class ExtractorHelper { } } + /** + * @deprecated Use {@link #getRelatedItemsOrLogError(StreamInfo, StreamExtractor)} + */ + @Deprecated + public static List getRelatedVideosOrLogError(StreamInfo info, StreamExtractor extractor) { + return getRelatedItemsOrLogError(info, extractor); + } + }