diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-10-06 17:19:39 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-10-06 17:19:39 -0700 |
commit | bb6fb803f4fdf61f9bce5492f58ccfebce192b55 (patch) | |
tree | 74378b9af7522747fcf29669f4e16e54c81447dd /app/src/main/java | |
parent | cc297c649b9008fd8648f1b8791ed0ef583eb58b (diff) | |
download | dsub-bb6fb803f4fdf61f9bce5492f58ccfebce192b55.tar.gz dsub-bb6fb803f4fdf61f9bce5492f58ccfebce192b55.tar.bz2 dsub-bb6fb803f4fdf61f9bce5492f58ccfebce192b55.zip |
When multiselecting videos directly download them
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 2 | ||||
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java | 18 |
2 files changed, 15 insertions, 5 deletions
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> entry) throws Exception { - getSongsRecursively(entry, songs); + getSongsRecursively(entry, false); + } + protected void getSongsRecursively(List<Entry> entry, boolean allowVideo) throws Exception { + getSongsRecursively(entry, songs, allowVideo); } protected void getSongsRecursively(List<Entry> entry, List<Entry> songs) throws Exception { + getSongsRecursively(entry, songs, false); + } + protected void getSongsRecursively(List<Entry> entry, List<Entry> 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<Entry> songs) throws Exception { + getSongsRecursively(parent, songs, false); + } + protected void getSongsRecursively(MusicDirectory parent, List<Entry> 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); } } |