|
28 | 28 | import org.schabi.newpipe.NewPipeDatabase; |
29 | 29 | import org.schabi.newpipe.R; |
30 | 30 | import org.schabi.newpipe.database.playlist.model.PlaylistRemoteEntity; |
| 31 | +import org.schabi.newpipe.database.stream.model.StreamEntity; |
31 | 32 | import org.schabi.newpipe.databinding.PlaylistControlBinding; |
32 | 33 | import org.schabi.newpipe.databinding.PlaylistHeaderBinding; |
33 | 34 | import org.schabi.newpipe.error.ErrorInfo; |
|
41 | 42 | import org.schabi.newpipe.extractor.stream.StreamInfoItem; |
42 | 43 | import org.schabi.newpipe.fragments.list.BaseListInfoFragment; |
43 | 44 | import org.schabi.newpipe.info_list.dialog.InfoItemDialog; |
| 45 | +import org.schabi.newpipe.local.dialog.PlaylistDialog; |
44 | 46 | import org.schabi.newpipe.local.playlist.RemotePlaylistManager; |
45 | 47 | import org.schabi.newpipe.player.MainPlayer.PlayerType; |
46 | 48 | import org.schabi.newpipe.player.playqueue.PlayQueue; |
|
56 | 58 | import java.util.List; |
57 | 59 | import java.util.concurrent.atomic.AtomicBoolean; |
58 | 60 | import java.util.function.Supplier; |
| 61 | +import java.util.stream.Collectors; |
59 | 62 |
|
60 | 63 | import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers; |
61 | 64 | import io.reactivex.rxjava3.core.Flowable; |
@@ -237,6 +240,17 @@ public boolean onOptionsItemSelected(final MenuItem item) { |
237 | 240 | case R.id.menu_item_bookmark: |
238 | 241 | onBookmarkClicked(); |
239 | 242 | break; |
| 243 | + case R.id.menu_item_append_playlist: |
| 244 | + disposables.add(PlaylistDialog.createCorrespondingDialog( |
| 245 | + getContext(), |
| 246 | + getPlayQueue() |
| 247 | + .getStreams() |
| 248 | + .stream() |
| 249 | + .map(StreamEntity::new) |
| 250 | + .collect(Collectors.toList()), |
| 251 | + dialog -> dialog.show(getFM(), TAG) |
| 252 | + )); |
| 253 | + break; |
240 | 254 | default: |
241 | 255 | return super.onOptionsItemSelected(item); |
242 | 256 | } |
|
0 commit comments