From 7cbe84d2b2d28129e3814471c85fda469d120bc5 Mon Sep 17 00:00:00 2001 From: polymorphicshade Date: Sat, 4 Sep 2021 13:58:14 -0600 Subject: [PATCH] fixed download issue and updated version string --- app/build.gradle | 2 +- .../fragments/detail/VideoDetailFragment.java | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 9cf346322..f693b0d45 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -18,7 +18,7 @@ android { minSdkVersion 19 targetSdkVersion 29 versionCode 975 - versionName "0.21.9" + versionName "0.21.9_r2" multiDexEnabled true diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java index 561e264ea..2971201a6 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java @@ -91,6 +91,7 @@ import org.schabi.newpipe.util.Constants; import org.schabi.newpipe.util.DeviceUtils; import org.schabi.newpipe.util.ExtractorHelper; import org.schabi.newpipe.util.ImageDisplayConstants; +import org.schabi.newpipe.util.VideoSegment; import org.schabi.newpipe.util.external_communication.KoreUtils; import org.schabi.newpipe.util.ListHelper; import org.schabi.newpipe.util.Localization; @@ -1623,12 +1624,18 @@ public final class VideoDetailFragment } videoSegmentsSubscriber = Single.fromCallable(() -> { + VideoSegment[] videoSegments = null; + try { - return SponsorBlockUtils.getYouTubeVideoSegments(getContext(), currentInfo); + videoSegments = + SponsorBlockUtils.getYouTubeVideoSegments(getContext(), currentInfo); } catch (final Exception e) { - // TODO: handle - return null; + // TODO: handle? } + + return videoSegments == null + ? new VideoSegment[0] + : videoSegments; }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread())