aboutsummaryrefslogtreecommitdiff
path: root/src/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-02-24 20:25:21 -0800
committerScott Jackson <daneren2005@gmail.com>2015-02-24 20:25:21 -0800
commit8d66335bf5500b2aa2d80febb5c90c4237a4579a (patch)
tree11e748565ecc0ec0d23eabb92cedeb94b696f09c /src/github
parent43cbeb065de81f18b63331b8e98f325e79fda3ef (diff)
downloaddsub-8d66335bf5500b2aa2d80febb5c90c4237a4579a.tar.gz
dsub-8d66335bf5500b2aa2d80febb5c90c4237a4579a.tar.bz2
dsub-8d66335bf5500b2aa2d80febb5c90c4237a4579a.zip
#458 Add musicFolderId checking for additional methods added to 5.2
Diffstat (limited to 'src/github')
-rw-r--r--src/github/daneren2005/dsub/service/RESTMusicService.java30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/github/daneren2005/dsub/service/RESTMusicService.java b/src/github/daneren2005/dsub/service/RESTMusicService.java
index 715d07da..341b1158 100644
--- a/src/github/daneren2005/dsub/service/RESTMusicService.java
+++ b/src/github/daneren2005/dsub/service/RESTMusicService.java
@@ -594,9 +594,22 @@ public class RESTMusicService implements MusicService {
@Override
public MusicDirectory getStarredList(Context context, ProgressListener progressListener) throws Exception {
- Reader reader = getReader(context, progressListener, Util.isTagBrowsing(context, getInstance(context)) ? "getStarred2" : "getStarred", null);
+ List<String> names = new ArrayList<String>();
+ List<Object> values = new ArrayList<Object>();
+
+ // Add folder if it was set and is non null
+ int instance = getInstance(context);
+ if(Util.getAlbumListsPerFolder(context, instance)) {
+ String folderId = Util.getSelectedMusicFolderId(context, instance);
+ if(folderId != null) {
+ names.add("musicFolderId");
+ values.add(folderId);
+ }
+ }
+
+ Reader reader = getReader(context, progressListener, Util.isTagBrowsing(context, instance) ? "getStarred2" : "getStarred", null, names, values);
try {
- return new StarredListParser(context, getInstance(context)).parse(reader, progressListener);
+ return new StarredListParser(context, instance).parse(reader, progressListener);
} finally {
Util.close(reader);
}
@@ -1103,10 +1116,19 @@ public class RESTMusicService implements MusicService {
parameterNames.add("offset");
parameterValues.add(offset);
- Reader reader = getReader(context, progressListener, "getSongsByGenre", params, parameterNames, parameterValues);
+ // Add folder if it was set and is non null
+ int instance = getInstance(context);
+ if(Util.getAlbumListsPerFolder(context, instance)) {
+ String folderId = Util.getSelectedMusicFolderId(context, instance);
+ if(folderId != null) {
+ parameterNames.add("musicFolderId");
+ parameterValues.add(folderId);
+ }
+ }
+ Reader reader = getReader(context, progressListener, "getSongsByGenre", params, parameterNames, parameterValues);
try {
- return new RandomSongsParser(context, getInstance(context)).parse(reader, progressListener);
+ return new RandomSongsParser(context, instance).parse(reader, progressListener);
} finally {
Util.close(reader);
}