fix: don't auto-add live videos to the playing queue

This commit is contained in:
Bnyro 2023-12-28 18:25:52 +01:00
parent c28cbe7f11
commit a6c82662c1
2 changed files with 3 additions and 1 deletions

View File

@ -24,6 +24,8 @@ data class StreamItem(
val shortDescription: String? = null,
val isShort: Boolean = false
) : Parcelable {
val isLive get() = (duration ?: 0L) < 0L
fun toLocalPlaylistItem(playlistId: String): LocalPlaylistItem {
return LocalPlaylistItem(
playlistId = playlistId.toInt(),

View File

@ -212,7 +212,7 @@ object PlayingQueue {
// don't add new videos to the queue if the user chose to repeat only the current queue
if (isLast() && repeatMode == Player.REPEAT_MODE_ALL) return
add(*streams.toTypedArray(), skipExisting = true)
add(*streams.filter { !it.isLive }.toTypedArray(), skipExisting = true)
}
fun onQueueItemSelected(index: Int) {