aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2016-02-04 18:38:51 -0800
committerScott Jackson <daneren2005@gmail.com>2016-02-04 18:38:51 -0800
commit62aa673906cc6ecb1d5b19262ab2d918cd8f1b6d (patch)
tree56f081c3adb3ffa49a5eddae29e992f5d76eed98 /app/src/main
parent96f0553dcd8ce4867a689e4026c159bc565a1282 (diff)
downloaddsub-62aa673906cc6ecb1d5b19262ab2d918cd8f1b6d.tar.gz
dsub-62aa673906cc6ecb1d5b19262ab2d918cd8f1b6d.tar.bz2
dsub-62aa673906cc6ecb1d5b19262ab2d918cd8f1b6d.zip
Add ability to update music folders + have on by default in create
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/adapter/SettingsAdapter.java9
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java9
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/UserUtil.java2
3 files changed, 15 insertions, 5 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/adapter/SettingsAdapter.java b/app/src/main/java/github/daneren2005/dsub/adapter/SettingsAdapter.java
index d1deaf6f..ba4b11fc 100644
--- a/app/src/main/java/github/daneren2005/dsub/adapter/SettingsAdapter.java
+++ b/app/src/main/java/github/daneren2005/dsub/adapter/SettingsAdapter.java
@@ -55,10 +55,11 @@ public class SettingsAdapter extends SectionAdapter<Setting> {
this.editable = editable;
this.onItemClickedListener = onItemClickedListener;
- List<Setting> settings = sections.get(0);
- for(Setting setting: settings) {
- if(setting.getValue()) {
- addSelected(setting);
+ for(List<Setting> settings: sections) {
+ for (Setting setting : settings) {
+ if (setting.getValue()) {
+ addSelected(setting);
+ }
}
}
}
diff --git a/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java b/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java
index a5bb3597..abc743f7 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java
@@ -1533,6 +1533,15 @@ public class RESTMusicService implements MusicService {
}
}
+ if(user.getMusicFolderSettings() != null) {
+ for(User.Setting setting: user.getMusicFolderSettings()) {
+ if(setting.getValue()) {
+ names.add("musicFolderId");
+ values.add(setting.getName());
+ }
+ }
+ }
+
Reader reader = getReader(context, progressListener, "updateUser", null, names, values);
try {
new ErrorParser(context, getInstance(context)).parse(reader);
diff --git a/app/src/main/java/github/daneren2005/dsub/util/UserUtil.java b/app/src/main/java/github/daneren2005/dsub/util/UserUtil.java
index bf5d3a29..3f16de21 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/UserUtil.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/UserUtil.java
@@ -386,7 +386,7 @@ public final class UserUtil {
if(sampleUser.getMusicFolderSettings() != null) {
for(User.Setting setting: sampleUser.getMusicFolderSettings()) {
User.MusicFolderSetting musicFolderSetting = (User.MusicFolderSetting) setting;
- user.addMusicFolder(musicFolderSetting, false);
+ user.addMusicFolder(musicFolderSetting, true);
}
}