Merge pull request #3466 from B0pol/soundCloudComments

adapt CommentsInfoItemExtractorRefactoring
This commit is contained in:
wb9688 2020-05-07 16:06:15 +02:00 committed by GitHub
commit 2060312dc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View file

@ -157,7 +157,7 @@ dependencies {
exclude module: 'support-annotations' exclude module: 'support-annotations'
}) })
implementation 'com.github.TeamNewPipe:NewPipeExtractor:fc3a69ed54b393e3e4e3a78ae6e89edc1d47c45a' implementation 'com.github.TeamNewPipe:NewPipeExtractor:665c69b5306d335985d5c0692f5119b5172c1b7a'
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.23.0' testImplementation 'org.mockito:mockito-core:2.23.0'

View file

@ -48,6 +48,6 @@ public class CommentsInfoItemHolder extends CommentsMiniInfoItemHolder {
} }
final CommentsInfoItem item = (CommentsInfoItem) infoItem; final CommentsInfoItem item = (CommentsInfoItem) infoItem;
itemTitleView.setText(item.getAuthorName()); itemTitleView.setText(item.getUploaderName());
} }
} }

View file

@ -89,7 +89,7 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder {
final CommentsInfoItem item = (CommentsInfoItem) infoItem; final CommentsInfoItem item = (CommentsInfoItem) infoItem;
itemBuilder.getImageLoader() itemBuilder.getImageLoader()
.displayImage(item.getAuthorThumbnail(), .displayImage(item.getUploaderAvatarUrl(),
itemThumbnailView, itemThumbnailView,
ImageDisplayConstants.DISPLAY_THUMBNAIL_OPTIONS); ImageDisplayConstants.DISPLAY_THUMBNAIL_OPTIONS);
@ -114,10 +114,10 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder {
itemLikesCountView.setText("-"); itemLikesCountView.setText("-");
} }
if (item.getPublishedTime() != null) { if (item.getUploadDate() != null) {
itemPublishedTime.setText(Localization.relativeTime(item.getPublishedTime().date())); itemPublishedTime.setText(Localization.relativeTime(item.getUploadDate().date()));
} else { } else {
itemPublishedTime.setText(item.getTextualPublishedTime()); itemPublishedTime.setText(item.getTextualUploadDate());
} }
itemView.setOnClickListener(view -> { itemView.setOnClickListener(view -> {
@ -143,7 +143,7 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder {
} }
private void openCommentAuthor(final CommentsInfoItem item) { private void openCommentAuthor(final CommentsInfoItem item) {
if (StringUtil.isBlank(item.getAuthorEndpoint())) { if (StringUtil.isBlank(item.getUploaderUrl())) {
return; return;
} }
try { try {
@ -151,8 +151,8 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder {
NavigationHelper.openChannelFragment( NavigationHelper.openChannelFragment(
activity.getSupportFragmentManager(), activity.getSupportFragmentManager(),
item.getServiceId(), item.getServiceId(),
item.getAuthorEndpoint(), item.getUploaderUrl(),
item.getAuthorName()); item.getUploaderName());
} catch (Exception e) { } catch (Exception e) {
ErrorActivity.reportUiError((AppCompatActivity) itemBuilder.getContext(), e); ErrorActivity.reportUiError((AppCompatActivity) itemBuilder.getContext(), e);
} }