@@ -25,6 +25,7 @@ import androidx.compose.material.icons.filled.Share
2525import androidx.compose.ui.graphics.vector.ImageVector
2626import androidx.core.net.toUri
2727import kotlinx.coroutines.Dispatchers
28+ import kotlinx.coroutines.reactive.awaitFirst
2829import kotlinx.coroutines.rx3.await
2930import kotlinx.coroutines.rx3.awaitSingle
3031import kotlinx.coroutines.withContext
@@ -47,6 +48,7 @@ import org.schabi.newpipe.local.history.HistoryRecordManager
4748import org.schabi.newpipe.local.playlist.LocalPlaylistManager
4849import org.schabi.newpipe.player.helper.PlayerHolder
4950import org.schabi.newpipe.player.playqueue.ChannelTabPlayQueue
51+ import org.schabi.newpipe.player.playqueue.LocalPlaylistPlayQueue
5052import org.schabi.newpipe.player.playqueue.PlayQueue
5153import org.schabi.newpipe.player.playqueue.PlayQueueItem
5254import org.schabi.newpipe.player.playqueue.PlaylistPlayQueue
@@ -93,10 +95,7 @@ data class LongPressAction(
9395 UnsetPlaylistThumbnail (18 , R .string.unset_playlist_thumbnail, Icons .Default .HideImage ),
9496 Unsubscribe (19 , R .string.unsubscribe, Icons .Default .Delete ),
9597 ShowDetails (20 , R .string.play_queue_stream_detail, Icons .Default .Info ),
96- Remove (21 , R .string.play_queue_remove, Icons .Default .Delete )
97- ;
98-
99- // TODO add actions that use the whole list the item belongs to (see wholeListQueue)
98+ Remove (21 , R .string.play_queue_remove, Icons .Default .Delete );
10099
101100 fun buildAction (
102101 enabled : () -> Boolean = { true },
@@ -338,13 +337,14 @@ data class LongPressAction(
338337 onDelete : Runnable ,
339338 unsetPlaylistThumbnail : Runnable ?
340339 ): List <LongPressAction > {
341- return listOf (
342- Type .Rename .buildAction { onRename.run () },
343- Type .Delete .buildAction { onDelete.run () },
344- Type .UnsetPlaylistThumbnail .buildAction(
345- enabled = { unsetPlaylistThumbnail != null }
346- ) { unsetPlaylistThumbnail?.run () }
347- )
340+ return buildPlayerActionList { LocalPlaylistPlayQueue (item) } +
341+ listOf (
342+ Type .Rename .buildAction { onRename.run () },
343+ Type .Delete .buildAction { onDelete.run () },
344+ Type .UnsetPlaylistThumbnail .buildAction(
345+ enabled = { unsetPlaylistThumbnail != null }
346+ ) { unsetPlaylistThumbnail?.run () }
347+ )
348348 }
349349
350350 @JvmStatic
0 commit comments