Skip to content

Commit 27f6c3b

Browse files
authored
Merge pull request TeamNewPipe#9502 from Jared234/8585_download_in_queue
Added option to download items in the queue
2 parents 367ece8 + b3bfec9 commit 27f6c3b

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

app/src/main/java/org/schabi/newpipe/QueueItemMenuUtil.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.schabi.newpipe;
22

3+
import static org.schabi.newpipe.util.SparseItemUtil.fetchStreamInfoAndSaveToDatabase;
34
import static org.schabi.newpipe.util.external_communication.ShareUtils.shareText;
45

56
import android.content.Context;
@@ -10,6 +11,7 @@
1011
import androidx.fragment.app.FragmentManager;
1112

1213
import org.schabi.newpipe.database.stream.model.StreamEntity;
14+
import org.schabi.newpipe.download.DownloadDialog;
1315
import org.schabi.newpipe.local.dialog.PlaylistDialog;
1416
import org.schabi.newpipe.player.playqueue.PlayQueue;
1517
import org.schabi.newpipe.player.playqueue.PlayQueueItem;
@@ -75,6 +77,14 @@ public static void openPopupMenu(final PlayQueue playQueue,
7577
shareText(context, item.getTitle(), item.getUrl(),
7678
item.getThumbnailUrl());
7779
return true;
80+
case R.id.menu_item_download:
81+
fetchStreamInfoAndSaveToDatabase(context, item.getServiceId(), item.getUrl(),
82+
info -> {
83+
final DownloadDialog downloadDialog = new DownloadDialog(context,
84+
info);
85+
downloadDialog.show(fragmentManager, "downloadDialog");
86+
});
87+
return true;
7888
}
7989
return false;
8090
});

app/src/main/res/menu/menu_play_queue_item.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@
1616
<item
1717
android:id="@+id/menu_item_share"
1818
android:title="@string/share" />
19+
<item
20+
android:id="@+id/menu_item_download"
21+
android:title="@string/download" />
1922
</menu>

0 commit comments

Comments
 (0)