From 7cd3603bbb285db7730a2153c66b3a5ac1c49af1 Mon Sep 17 00:00:00 2001 From: Douile <25043847+Douile@users.noreply.github.com> Date: Fri, 3 Dec 2021 22:38:03 +0000 Subject: [PATCH] Fetch sparse items when playing in background or popup --- .../newpipe/util/StreamDialogEntry.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/util/StreamDialogEntry.java b/app/src/main/java/org/schabi/newpipe/util/StreamDialogEntry.java index 82701723b..ac05e3460 100644 --- a/app/src/main/java/org/schabi/newpipe/util/StreamDialogEntry.java +++ b/app/src/main/java/org/schabi/newpipe/util/StreamDialogEntry.java @@ -73,13 +73,20 @@ public enum StreamDialogEntry { ); }), - start_here_on_background(R.string.start_here_on_background, (fragment, item) -> - NavigationHelper.playOnBackgroundPlayer(fragment.getContext(), - new SinglePlayQueue(item), true)), + start_here_on_background(R.string.start_here_on_background, (fragment, item) -> { + fetchItemInfoIfSparse(fragment, item, + fullItem -> { + NavigationHelper.playOnBackgroundPlayer(fragment.getContext(), + fullItem, true); + }); + }), - start_here_on_popup(R.string.start_here_on_popup, (fragment, item) -> - NavigationHelper.playOnPopupPlayer(fragment.getContext(), - new SinglePlayQueue(item), true)), + start_here_on_popup(R.string.start_here_on_popup, (fragment, item) -> { + fetchItemInfoIfSparse(fragment, item, fullItem -> { + NavigationHelper.playOnPopupPlayer(fragment.getContext(), + fullItem, true); + }); + }), set_as_playlist_thumbnail(R.string.set_as_playlist_thumbnail, (fragment, item) -> { }), // has to be set manually