From b44acdd519fb42a73d76376c4c83b7898c443f7f Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Wed, 23 Oct 2024 19:31:21 +0200 Subject: [PATCH] remove unused saveInstanceState and add check to timeline change --- .../src/main/java/net/newpipe/newplayer/NewPlayerImpl.kt | 9 ++++++--- .../newpipe/newplayer/uiModel/NewPlayerViewModelImpl.kt | 3 --- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/new-player/src/main/java/net/newpipe/newplayer/NewPlayerImpl.kt b/new-player/src/main/java/net/newpipe/newplayer/NewPlayerImpl.kt index 6bc0776..39746d7 100644 --- a/new-player/src/main/java/net/newpipe/newplayer/NewPlayerImpl.kt +++ b/new-player/src/main/java/net/newpipe/newplayer/NewPlayerImpl.kt @@ -31,6 +31,7 @@ import androidx.media3.common.C import androidx.media3.common.MediaItem import androidx.media3.common.PlaybackException import androidx.media3.common.Player +import androidx.media3.common.Player.TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED import androidx.media3.common.Timeline import androidx.media3.common.Tracks import androidx.media3.common.util.UnstableApi @@ -202,9 +203,11 @@ class NewPlayerImpl( override fun onTimelineChanged(timeline: Timeline, reason: Int) { // TODO shouldn't you check that reason == TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED - mutablePlaylist.update { - (0..