From ae437b1510e7b83b2d40df8704192c4e3e57a200 Mon Sep 17 00:00:00 2001 From: wb9688 Date: Fri, 8 May 2020 18:03:19 +0200 Subject: [PATCH] Bump NewPipeExtractor --- app/build.gradle | 2 +- .../fragments/detail/VideoDetailFragment.java | 6 ++++-- .../list/channel/ChannelFragment.java | 20 +++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index eeda33f50..64b73d77b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -158,7 +158,7 @@ dependencies { exclude module: 'support-annotations' }) - implementation 'com.github.Royosef:NewPipeExtractor:a4086617719e53b293efa1e8873799ba7714cb14' + implementation 'com.github.TeamNewPipe:NewPipeExtractor:f3913e241e379adf0091319091e8f895c5fcfd07' 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 e65da09fb..b0da6ac29 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 @@ -422,11 +422,13 @@ public class VideoDetailFragment extends BaseStateFragment break; case R.id.detail_uploader_root_layout: if (TextUtils.isEmpty(currentInfo.getSubChannelUrl())) { - Log.w(TAG, "Can't open sub-channel because we got no channel URL"); - if (!TextUtils.isEmpty(currentInfo.getUploaderUrl())) { openChannel(currentInfo.getUploaderUrl(), currentInfo.getUploaderName()); } + + if (DEBUG) { + Log.i(TAG, "Can't open sub-channel because we got no channel URL"); + } } else { openChannel(currentInfo.getSubChannelUrl(), currentInfo.getSubChannelName()); diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java index eccedd0ed..a9b703b14 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java @@ -423,18 +423,16 @@ public class ChannelFragment extends BaseListInfoFragment switch (v.getId()) { case R.id.sub_channel_avatar_view: case R.id.sub_channel_title_view: - if (TextUtils.isEmpty(currentInfo.getSubChannelUrl())) { - Log.w(TAG, "Can't open sub-channel because we got no channel URL"); - } else { + if (!TextUtils.isEmpty(currentInfo.getParentChannelUrl())) { try { - NavigationHelper.openChannelFragment( - getFragmentManager(), - currentInfo.getServiceId(), - currentInfo.getSubChannelUrl(), - currentInfo.getSubChannelName()); + NavigationHelper.openChannelFragment(getFragmentManager(), + currentInfo.getServiceId(), currentInfo.getParentChannelUrl(), + currentInfo.getParentChannelName()); } catch (Exception e) { ErrorActivity.reportUiError((AppCompatActivity) getActivity(), e); } + } else if (DEBUG) { + Log.i(TAG, "Can't open parent channel because we got no channel URL"); } break; } @@ -463,7 +461,7 @@ public class ChannelFragment extends BaseListInfoFragment ImageDisplayConstants.DISPLAY_BANNER_OPTIONS); IMAGE_LOADER.displayImage(result.getAvatarUrl(), headerAvatarView, ImageDisplayConstants.DISPLAY_AVATAR_OPTIONS); - IMAGE_LOADER.displayImage(result.getSubChannelAvatarUrl(), headerSubChannelAvatarView, + IMAGE_LOADER.displayImage(result.getParentChannelAvatarUrl(), headerSubChannelAvatarView, ImageDisplayConstants.DISPLAY_AVATAR_OPTIONS); headerSubscribersTextView.setVisibility(View.VISIBLE); @@ -474,10 +472,10 @@ public class ChannelFragment extends BaseListInfoFragment headerSubscribersTextView.setText(R.string.subscribers_count_not_available); } - if (!TextUtils.isEmpty(currentInfo.getSubChannelName())) { + if (!TextUtils.isEmpty(currentInfo.getParentChannelName())) { headerSubChannelTitleView.setText(String.format( getString(R.string.channel_created_by), - currentInfo.getSubChannelName()) + currentInfo.getParentChannelName()) ); headerSubChannelTitleView.setVisibility(View.VISIBLE); headerSubChannelAvatarView.setVisibility(View.VISIBLE);