mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
Merge pull request #6940 from Bnyro/master
fix: crash when all caught up view appearing in subscriptions
This commit is contained in:
commit
f38f0ed706
@ -93,12 +93,8 @@ class VideosAdapter(
|
|||||||
val video = streamItems[position]
|
val video = streamItems[position]
|
||||||
val videoId = video.url.orEmpty().toID()
|
val videoId = video.url.orEmpty().toID()
|
||||||
|
|
||||||
(holder.trendingRowBinding?.watchProgress ?: holder.videoRowBinding!!.watchProgress)
|
|
||||||
.setWatchProgressLength(videoId, video.duration ?: 0L)
|
|
||||||
|
|
||||||
val context = (
|
val context = (
|
||||||
holder.videoRowBinding ?: holder.trendingRowBinding
|
holder.videoRowBinding ?: holder.trendingRowBinding ?: holder.allCaughtUpBinding
|
||||||
?: holder.allCaughtUpBinding
|
|
||||||
)!!.root.context
|
)!!.root.context
|
||||||
val activity = (context as BaseActivity)
|
val activity = (context as BaseActivity)
|
||||||
val fragmentManager = activity.supportFragmentManager
|
val fragmentManager = activity.supportFragmentManager
|
||||||
@ -111,6 +107,7 @@ class VideosAdapter(
|
|||||||
width = 250f.dpToPx()
|
width = 250f.dpToPx()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
watchProgress.setWatchProgressLength(videoId, video.duration ?: 0L)
|
||||||
|
|
||||||
textViewTitle.text = video.title
|
textViewTitle.text = video.title
|
||||||
textViewChannel.text = TextUtils.formatViewsString(root.context, video.views ?: -1, video.uploaded, video.uploaderName)
|
textViewChannel.text = TextUtils.formatViewsString(root.context, video.views ?: -1, video.uploaded, video.uploaderName)
|
||||||
@ -145,6 +142,7 @@ class VideosAdapter(
|
|||||||
videoInfo.text = TextUtils.formatViewsString(root.context, video.views ?: -1, video.uploaded)
|
videoInfo.text = TextUtils.formatViewsString(root.context, video.views ?: -1, video.uploaded)
|
||||||
|
|
||||||
video.duration?.let { thumbnailDuration.setFormattedDuration(it, video.isShort, video.uploaded) }
|
video.duration?.let { thumbnailDuration.setFormattedDuration(it, video.isShort, video.uploaded) }
|
||||||
|
watchProgress.setWatchProgressLength(videoId, video.duration ?: 0L)
|
||||||
ImageHelper.loadImage(video.thumbnail, thumbnail)
|
ImageHelper.loadImage(video.thumbnail, thumbnail)
|
||||||
|
|
||||||
if (forceMode != LayoutMode.CHANNEL_ROW) {
|
if (forceMode != LayoutMode.CHANNEL_ROW) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user