From 56cb8209b8ec8ba1d2d8fef0955ee2359347b3df Mon Sep 17 00:00:00 2001 From: Ritvik Saraf <13ritvik@gmail.com> Date: Sat, 16 Feb 2019 01:23:26 +0530 Subject: [PATCH] refactored comments capability --- app/build.gradle | 2 +- .../newpipe/fragments/detail/VideoDetailFragment.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f47db03d0..f135bb017 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -57,7 +57,7 @@ dependencies { exclude module: 'support-annotations' }) - implementation 'com.github.yausername:NewPipeExtractor:f97d5ab' + implementation 'com.github.yausername:NewPipeExtractor:3dadf63' testImplementation 'junit:junit:4.12' testImplementation 'org.mockito:mockito-core:2.23.0' 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 c007789e5..63f4fc722 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 @@ -100,6 +100,7 @@ import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.Disposable; import io.reactivex.schedulers.Schedulers; +import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.COMMENTS; import static org.schabi.newpipe.util.AnimationUtils.animateView; public class VideoDetailFragment @@ -822,7 +823,10 @@ public class VideoDetailFragment private boolean shouldShowComments() { try { - return showComments && NewPipe.getService(serviceId).isCommentsSupported(); + return showComments && NewPipe.getService(serviceId) + .getServiceInfo() + .getMediaCapabilities() + .contains(COMMENTS); } catch (ExtractionException e) { return false; }