From 06c42b99f67f8cd831b836de23cc616d2a5e3532 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sun, 24 Nov 2024 14:14:12 +0100 Subject: [PATCH] fix: missing title and chapters in downloads video player --- .../github/libretube/ui/activities/OfflinePlayerActivity.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/src/main/java/com/github/libretube/ui/activities/OfflinePlayerActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/OfflinePlayerActivity.kt index d578f78a01..2f9e49a202 100644 --- a/app/src/main/java/com/github/libretube/ui/activities/OfflinePlayerActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/OfflinePlayerActivity.kt @@ -193,9 +193,7 @@ class OfflinePlayerActivity : BaseActivity() { binding.playerGestureControlsView.binding, chaptersViewModel ) - } - private fun playVideo() { lifecycleScope.launch { val (downloadInfo, downloadItems, downloadChapters) = withContext(Dispatchers.IO) { Database.downloadDao().findById(videoId) @@ -205,11 +203,10 @@ class OfflinePlayerActivity : BaseActivity() { chaptersViewModel.chaptersLiveData.value = chapters binding.player.setChapters(chapters) - val downloadFiles = downloadItems.filter { it.path.exists() } playerBinding.exoTitle.text = downloadInfo.title playerBinding.exoTitle.isVisible = true - timeFrameReceiver = downloadFiles.firstOrNull { it.type == FileType.VIDEO }?.path?.let { + timeFrameReceiver = downloadItems.firstOrNull { it.path.exists() && it.type == FileType.VIDEO }?.path?.let { OfflineTimeFrameReceiver(this@OfflinePlayerActivity, it) } }