aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2013-11-05 16:55:04 -0800
committerdaneren2005 <daneren2005@gmail.com>2013-11-05 16:55:04 -0800
commita32d17cf4810ba2477f2c5077e975d7c6fcd74be (patch)
tree04357f5d688b3cad830be292f8c522f376986c14 /src/github/daneren2005
parent483780f829911727c5ac433f9c804a6410f6f350 (diff)
downloaddsub-a32d17cf4810ba2477f2c5077e975d7c6fcd74be.tar.gz
dsub-a32d17cf4810ba2477f2c5077e975d7c6fcd74be.tar.bz2
dsub-a32d17cf4810ba2477f2c5077e975d7c6fcd74be.zip
Filled in stub methods for ratings/bookmarks
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r--src/github/daneren2005/dsub/service/RESTMusicService.java37
1 files changed, 33 insertions, 4 deletions
diff --git a/src/github/daneren2005/dsub/service/RESTMusicService.java b/src/github/daneren2005/dsub/service/RESTMusicService.java
index 2e7d1892..baae7036 100644
--- a/src/github/daneren2005/dsub/service/RESTMusicService.java
+++ b/src/github/daneren2005/dsub/service/RESTMusicService.java
@@ -70,6 +70,7 @@ import android.util.Log;
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.domain.*;
import github.daneren2005.dsub.service.parser.AlbumListParser;
+import github.daneren2005.dsub.service.parser.BookmarkParser;
import github.daneren2005.dsub.service.parser.ChatMessageParser;
import github.daneren2005.dsub.service.parser.ErrorParser;
import github.daneren2005.dsub.service.parser.GenreParser;
@@ -971,22 +972,50 @@ public class RESTMusicService implements MusicService {
@Override
public void setRating(String id, int rating, Context context, ProgressListener progressListener) throws Exception {
-
+ checkServerVersion(context, "1.6", "Setting ratings not supported.");
+
+ Reader reader = getReader(context, progressListener, "setRating", null, Arrays.asList("id", "rating"), Arrays.<Object>asList(id, rating));
+ try {
+ new ErrorParser(context).parse(reader);
+ } finally {
+ Util.close(reader);
+ }
}
@Override
public List<Bookmark> getBookmarks(boolean refresh, Context context, ProgressListener progressListener) throws Exception {
- return null;
+ checkServerVersion(context, "1.9", "Bookmarks not supported.");
+
+ Reader reader = getReader(context, progressListener, "getBookmarks", null);
+ try {
+ return new BookmarkParser(context).parse(reader, progressListener);
+ } finally {
+ Util.close(reader);
+ }
}
@Override
public void createBookmark(String id, int position, String comment, Context context, ProgressListener progressListener) throws Exception {
-
+ checkServerVersion(context, "1.9", "Creating bookmarks not supported.");
+
+ Reader reader = getReader(context, progressListener, "createBookmark", null, Arrays.asList("id", "position"), Arrays.<Object>asList(id, position));
+ try {
+ new ErrorParser(context).parse(reader);
+ } finally {
+ Util.close(reader);
+ }
}
@Override
public void deleteBookmark(String id, Context context, ProgressListener progressListener) throws Exception {
-
+ checkServerVersion(context, "1.9", "Deleting bookmarks not supported.");
+
+ Reader reader = getReader(context, progressListener, "deleteBookmark", null, Arrays.asList("id"), Arrays.<Object>asList(id));
+ try {
+ new ErrorParser(context).parse(reader);
+ } finally {
+ Util.close(reader);
+ }
}
@Override