From d715eae0d1fc2893aed4a7c057a01d3a6409b08a Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sat, 2 Jan 2016 01:33:08 +0100 Subject: [PATCH] route video downloads to "Movies" and audio to "Music" use the standard Android folders when downloading files. --- app/src/main/java/org/schabi/newpipe/DownloadDialog.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/DownloadDialog.java b/app/src/main/java/org/schabi/newpipe/DownloadDialog.java index a943ad423..3001455f9 100644 --- a/app/src/main/java/org/schabi/newpipe/DownloadDialog.java +++ b/app/src/main/java/org/schabi/newpipe/DownloadDialog.java @@ -61,21 +61,24 @@ public class DownloadDialog extends DialogFragment { String suffix = ""; String title = arguments.getString(TITLE); String url = ""; + String downloadFolder = "Download"; switch(which) { case 0: // Video suffix = arguments.getString(FILE_SUFFIX_VIDEO); url = arguments.getString(VIDEO_URL); + downloadFolder = "Movies"; break; case 1: suffix = arguments.getString(FILE_SUFFIX_AUDIO); url = arguments.getString(AUDIO_URL); + downloadFolder = "Music"; break; default: Log.d(TAG, "lolz"); } //to avoid hard-coded string like "/storage/emulated/0/Movies" String downloadPath = prefs.getString(getString(R.string.downloadPathPreference), - Environment.getExternalStorageDirectory().getAbsolutePath() + "/Movies"); + Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + downloadFolder); final File dir = new File(downloadPath); if(!dir.exists()) { boolean mkdir = dir.mkdir(); //attempt to create directory