aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/github/daneren2005/dsub/domain/User.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/github/daneren2005/dsub/domain/User.java')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/domain/User.java41
1 files changed, 39 insertions, 2 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/domain/User.java b/app/src/main/java/github/daneren2005/dsub/domain/User.java
index 797a1271..b5ee6188 100644
--- a/app/src/main/java/github/daneren2005/dsub/domain/User.java
+++ b/app/src/main/java/github/daneren2005/dsub/domain/User.java
@@ -15,6 +15,8 @@
package github.daneren2005.dsub.domain;
+import android.util.Pair;
+
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@@ -52,6 +54,7 @@ public class User implements Serializable {
private String email;
private List<Setting> settings = new ArrayList<Setting>();
+ private List<Setting> musicFolders;
public User() {
@@ -92,9 +95,27 @@ public class User implements Serializable {
settings.add(new Setting(name, value));
}
+ public void addMusicFolder(MusicFolder musicFolder) {
+ if(musicFolders == null) {
+ musicFolders = new ArrayList<>();
+ }
+
+ musicFolders.add(new MusicFolderSetting(musicFolder.getId(), musicFolder.getName(), false));
+ }
+ public void addMusicFolder(MusicFolderSetting musicFolderSetting, boolean defaultValue) {
+ if(musicFolders == null) {
+ musicFolders = new ArrayList<>();
+ }
+
+ musicFolders.add(new MusicFolderSetting(musicFolderSetting.getName(), musicFolderSetting.getLabel(), defaultValue));
+ }
+ public List<Setting> getMusicFolderSettings() {
+ return musicFolders;
+ }
+
public static class Setting implements Serializable {
- String name;
- Boolean value;
+ private String name;
+ private Boolean value;
public Setting() {
@@ -114,4 +135,20 @@ public class User implements Serializable {
this.value = value;
}
}
+
+ public static class MusicFolderSetting extends Setting {
+ private String label;
+
+ public MusicFolderSetting() {
+
+ }
+ public MusicFolderSetting(String name, String label, Boolean value) {
+ super(name, value);
+ this.label = label;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+ }
}