Skip to content

Commit a8505ce

Browse files
committed
fix(offline player): hide unavailable channel information (avatar, subscriptions count)
1 parent e312f92 commit a8505ce

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

app/src/main/java/com/github/libretube/db/obj/DownloadWithItems.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ data class DownloadWithItems(
4040
views = download.views,
4141
likes = download.likes,
4242
dislikes = download.dislikes,
43+
uploaderSubscriberCount = -1
4344
)
4445
}
4546

app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,12 +1171,17 @@ class PlayerFragment : Fragment(R.layout.fragment_player), CustomPlayerCallback
11711171

11721172
binding.apply {
11731173
ImageHelper.loadImage(streams.uploaderAvatar, binding.playerChannelImage, true)
1174+
binding.playerChannelImage.isVisible = streams.uploaderAvatar != null
1175+
11741176
playerChannelName.text = streams.uploader
11751177
titleTextView.text = streams.title
1178+
11761179
playerChannelSubCount.text = context?.getString(
11771180
R.string.subscribers,
11781181
streams.uploaderSubscriberCount.formatShort()
11791182
)
1183+
playerChannelSubCount.isVisible = streams.uploaderSubscriberCount >= 0
1184+
11801185
player.isLive = streams.isLive
11811186
relPlayerDownload.isVisible = !streams.isLive && !isOffline
11821187
}

0 commit comments

Comments
 (0)