Do not show the counter if ReturnYoutubeDislikes failed

This commit is contained in:
tr7zw 2022-01-28 21:44:16 +01:00
parent bc9303bd9a
commit 99d03d69de

View file

@ -1570,12 +1570,14 @@ public final class VideoDetailFragment
if (info.getDislikeCount() == -1) { if (info.getDislikeCount() == -1) {
new Thread(() -> { new Thread(() -> {
info.setDislikeCount(ReturnYoutubeDislikeUtils.getDislikes(info)); info.setDislikeCount(ReturnYoutubeDislikeUtils.getDislikes(info));
activity.runOnUiThread(() -> { if (info.getDislikeCount() >= 0) {
binding.detailThumbsDownCountView.setText(Localization activity.runOnUiThread(() -> {
.shortCount(activity, info.getDislikeCount())); binding.detailThumbsDownCountView.setText(Localization
binding.detailThumbsDownCountView.setVisibility(View.VISIBLE); .shortCount(activity, info.getDislikeCount()));
binding.detailThumbsDownImgView.setVisibility(View.VISIBLE); binding.detailThumbsDownCountView.setVisibility(View.VISIBLE);
}); binding.detailThumbsDownImgView.setVisibility(View.VISIBLE);
});
}
}).start(); }).start();
} }
if (info.getDislikeCount() >= 0) { if (info.getDislikeCount() >= 0) {