diff --git a/app/src/main/java/com/github/libretube/api/obj/StreamItem.kt b/app/src/main/java/com/github/libretube/api/obj/StreamItem.kt index b2383c31d9..31f439ed6c 100644 --- a/app/src/main/java/com/github/libretube/api/obj/StreamItem.kt +++ b/app/src/main/java/com/github/libretube/api/obj/StreamItem.kt @@ -24,7 +24,7 @@ data class StreamItem( val shortDescription: String? = null, val isShort: Boolean = false ) : Parcelable { - val isLive get() = (duration != null) && (duration <= 0L) + val isLive get() = (duration == null) || (duration <= 0L) fun toLocalPlaylistItem(playlistId: String): LocalPlaylistItem { return LocalPlaylistItem( diff --git a/app/src/main/java/com/github/libretube/db/obj/WatchHistoryItem.kt b/app/src/main/java/com/github/libretube/db/obj/WatchHistoryItem.kt index e8a79f712a..79b41fcb9a 100644 --- a/app/src/main/java/com/github/libretube/db/obj/WatchHistoryItem.kt +++ b/app/src/main/java/com/github/libretube/db/obj/WatchHistoryItem.kt @@ -21,6 +21,8 @@ data class WatchHistoryItem( @ColumnInfo val duration: Long? = null, @ColumnInfo val isShort: Boolean = false ) { + val isLive get() = (duration == null) || (duration <= 0L) + fun toStreamItem() = StreamItem( url = videoId, type = StreamItem.TYPE_STREAM, diff --git a/app/src/main/java/com/github/libretube/ui/adapters/WatchHistoryAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/WatchHistoryAdapter.kt index 1c0fdaa432..ee0c3db70a 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/WatchHistoryAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/WatchHistoryAdapter.kt @@ -92,7 +92,10 @@ class WatchHistoryAdapter( true } - if (video.duration != null) watchProgress.setWatchProgressLength(video.videoId, video.duration) + if (video.duration != null) watchProgress.setWatchProgressLength( + video.videoId, + video.duration + ) } } } diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt index f2fc1c64bb..39974783bc 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt @@ -1136,6 +1136,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions { streams.uploaderSubscriberCount.formatShort() ) player.isLive = streams.livestream + relPlayerDownload.isVisible = !streams.livestream } playerBinding.exoTitle.text = streams.title diff --git a/app/src/main/java/com/github/libretube/ui/sheets/VideoOptionsBottomSheet.kt b/app/src/main/java/com/github/libretube/ui/sheets/VideoOptionsBottomSheet.kt index c13d4231a9..bec7b3544c 100644 --- a/app/src/main/java/com/github/libretube/ui/sheets/VideoOptionsBottomSheet.kt +++ b/app/src/main/java/com/github/libretube/ui/sheets/VideoOptionsBottomSheet.kt @@ -52,6 +52,7 @@ class VideoOptionsBottomSheet : BaseBottomSheet() { } optionsList += listOf(R.string.addToPlaylist, R.string.download, R.string.share) + if (streamItem.isLive) optionsList.remove(R.string.download) setSimpleItems(optionsList.map { getString(it) }) { which -> when (optionsList[which]) {