aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2014-06-12 16:51:53 -0700
committerdaneren2005 <daneren2005@gmail.com>2014-06-12 16:51:53 -0700
commitfd36d1ed68a8c9083340362c4b2b58a13792bc43 (patch)
tree47797f941b57d1d5198777f47237f712737e16f9 /src
parent7cfa7eb26192a9ef2789c2aa16220f306a6259cd (diff)
downloaddsub-fd36d1ed68a8c9083340362c4b2b58a13792bc43.tar.gz
dsub-fd36d1ed68a8c9083340362c4b2b58a13792bc43.tar.bz2
dsub-fd36d1ed68a8c9083340362c4b2b58a13792bc43.zip
Use User constant instead of hard coding
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/service/parser/UserParser.java18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/github/daneren2005/dsub/service/parser/UserParser.java b/src/github/daneren2005/dsub/service/parser/UserParser.java
index 5b2f8fc1..6ec8f113 100644
--- a/src/github/daneren2005/dsub/service/parser/UserParser.java
+++ b/src/github/daneren2005/dsub/service/parser/UserParser.java
@@ -46,18 +46,10 @@ public class UserParser extends AbstractParser {
user.setUsername(get("username"));
user.setEmail(get("email"));
- parseSetting(user, "scrobblingEnabled");
- parseSetting(user, "adminRole");
- parseSetting(user, "settingsRole");
- parseSetting(user, "downloadRole");
- parseSetting(user, "uploadRole");
- // Depreciated: parseSetting(user, "playlistRole");
- parseSetting(user, "coverArtRole");
- parseSetting(user, "commentRole");
- parseSetting(user, "podcastRole");
- parseSetting(user, "streamRole");
- parseSetting(user, "jukeboxRole");
- parseSetting(user, "shareRole");
+ parseSetting(user, User.SCROBBLING);
+ for(String role: User.ROLES) {
+ parseSetting(user, role);
+ }
result.add(user);
} else if ("error".equals(name)) {
@@ -74,4 +66,4 @@ public class UserParser extends AbstractParser {
private void parseSetting(User user, String name) {
user.addSetting(name, getBoolean(name));
}
-} \ No newline at end of file
+}