From bb6fb803f4fdf61f9bce5492f58ccfebce192b55 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Tue, 6 Oct 2015 17:19:39 -0700 Subject: When multiselecting videos directly download them --- .../dsub/fragments/SelectDirectoryFragment.java | 2 +- .../daneren2005/dsub/fragments/SubsonicFragment.java | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index abd1c6aa..2db10c2e 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -858,7 +858,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Section RecursiveLoader onValid = new RecursiveLoader(context) { @Override protected Boolean doInBackground() throws Throwable { - getSongsRecursively(entries, songs); + getSongsRecursively(entries, true); getDownloadService().downloadBackground(songs, save); return null; } diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java index 8a0752be..8672f534 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -1943,7 +1943,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR new RecursiveLoader(context) { @Override protected Boolean doInBackground() throws Throwable { - getSongsRecursively(entries, songs); + getSongsRecursively(entries, true); getDownloadService().downloadBackground(songs, save); return null; } @@ -2018,14 +2018,24 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR } protected void getSongsRecursively(List entry) throws Exception { - getSongsRecursively(entry, songs); + getSongsRecursively(entry, false); + } + protected void getSongsRecursively(List entry, boolean allowVideo) throws Exception { + getSongsRecursively(entry, songs, allowVideo); } protected void getSongsRecursively(List entry, List songs) throws Exception { + getSongsRecursively(entry, songs, false); + } + protected void getSongsRecursively(List entry, List songs, boolean allowVideo) throws Exception { MusicDirectory dir = new MusicDirectory(); dir.addChildren(entry); - getSongsRecursively(dir, songs); + getSongsRecursively(dir, songs, allowVideo); } + protected void getSongsRecursively(MusicDirectory parent, List songs) throws Exception { + getSongsRecursively(parent, songs, false); + } + protected void getSongsRecursively(MusicDirectory parent, List songs, boolean allowVideo) throws Exception { if (songs.size() > MAX_SONGS) { return; } @@ -2045,7 +2055,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR } for (Entry song : parent.getChildren(false, true)) { - if (!song.isVideo() && song.getRating() != 1) { + if ((!song.isVideo() || allowVideo) && song.getRating() != 1) { songs.add(song); } } -- cgit v1.2.3