aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android
diff options
context:
space:
mode:
Diffstat (limited to 'subsonic-android')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/MusicService.java4
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java34
2 files changed, 19 insertions, 19 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/MusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/MusicService.java
index a6e20ca5..d6b88d83 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/MusicService.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/MusicService.java
@@ -60,6 +60,8 @@ public interface MusicService {
List<Playlist> getPlaylists(boolean refresh, Context context, ProgressListener progressListener) throws Exception;
void createPlaylist(String id, String name, List<MusicDirectory.Entry> entries, Context context, ProgressListener progressListener) throws Exception;
+
+ void addToPlaylist(String id, List<MusicDirectory.Entry> toAdd, Context context, ProgressListener progressListener) throws Exception;
Lyrics getLyrics(String artist, String title, Context context, ProgressListener progressListener) throws Exception;
@@ -92,6 +94,4 @@ public interface MusicService {
JukeboxStatus setJukeboxGain(float gain, Context context, ProgressListener progressListener) throws Exception;
void setStarred(String id, boolean starred, Context context, ProgressListener progressListener) throws Exception;
-
- void addToPlaylist(String id, List<MusicDirectory.Entry> toAdd, Context context, ProgressListener progressListener) throws Exception;
} \ No newline at end of file
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java
index b95ae0f7..acd3010e 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java
@@ -383,6 +383,23 @@ public class RESTMusicService implements MusicService {
Util.close(reader);
}
}
+
+ @Override
+ public void addToPlaylist(String id, List<MusicDirectory.Entry> toAdd, Context context, ProgressListener progressListener) throws Exception {
+ checkServerVersion(context, "1.8", "Updating playlists is not supported.");
+ List<String> names = Arrays.asList("playListID");
+ List<Object> values = Arrays.<Object>asList(id);
+ for(MusicDirectory.Entry song: toAdd) {
+ names.add("songIdToAdd");
+ values.add(song.getId());
+ }
+ Reader reader = getReader(context, progressListener, "updatePlaylist", null, names, values);
+ try {
+ new ErrorParser(context).parse(reader);
+ } finally {
+ Util.close(reader);
+ }
+ }
@Override
public Lyrics getLyrics(String artist, String title, Context context, ProgressListener progressListener) throws Exception {
@@ -625,23 +642,6 @@ public class RESTMusicService implements MusicService {
Util.close(reader);
}
}
-
- @Override
- public void addToPlaylist(String id, List<MusicDirectory.Entry> toAdd, Context context, ProgressListener progressListener) throws Exception {
- checkServerVersion(context, "1.8", "Updating playlists is not supported.");
- List<String> names = Arrays.asList("playListID");
- List<Object> values = Arrays.<Object>asList(id);
- for(MusicDirectory.Entry song: toAdd) {
- names.add("songIdToAdd");
- values.add(song.getId());
- }
- Reader reader = getReader(context, progressListener, "updatePlaylist", null, names, values);
- try {
- new ErrorParser(context).parse(reader);
- } finally {
- Util.close(reader);
- }
- }
private Reader getReader(Context context, ProgressListener progressListener, String method, HttpParams requestParams) throws Exception {
return getReader(context, progressListener, method, requestParams, Collections.<String>emptyList(), Collections.emptyList());