From d1add05bc180de04979769a2624cdb5a8344fe75 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Mon, 4 Oct 2021 01:28:07 +0100 Subject: [PATCH] Add requested changes. Co-authored-by: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com> Add final. Co-authored-by: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com> --- .../extractors/YoutubeStreamInfoItemExtractor.java | 8 +++++--- .../schabi/newpipe/extractor/stream/StreamInfoItem.java | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java index 5c903aef..e46a63a5 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java @@ -293,11 +293,13 @@ public class YoutubeStreamInfoItemExtractor implements StreamInfoItemExtractor { @Override public String getShortDescription() throws ParsingException { - if(videoInfo.has("detailedMetadataSnippets")) + if (videoInfo.has("detailedMetadataSnippets")) { return getTextFromObject(videoInfo.getArray("detailedMetadataSnippets").getObject(0).getObject("snippetText")); + } - if(videoInfo.has("descriptionSnippet")) - return getTextFromObject(videoInfo.getObject("descriptionSnippet")); + if (videoInfo.has("descriptionSnippet")) { + return getTextFromObject(videoInfo.getObject("descriptionSnippet")); + } return null; } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItem.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItem.java index d974ee2c..61690df7 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItem.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItem.java @@ -97,7 +97,7 @@ public class StreamInfoItem extends InfoItem { return shortDescription; } - public void setShortDescription(String shortDescription) { + public void setShortDescription(final String shortDescription) { this.shortDescription = shortDescription; }