adapt CommentsInfoItemExtractorRefactoring

This commit is contained in:
bopol 2020-04-21 20:08:47 +02:00
parent b630f269c4
commit d1c94f5120
3 changed files with 9 additions and 9 deletions

View File

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

View File

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