diff options
author | Scott Jackson <daneren2005@gmail.com> | 2012-10-21 15:09:50 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2012-10-21 15:09:50 -0700 |
commit | a90c77104abca83bce2623170e1b050b76da2045 (patch) | |
tree | 9d1f66a1ff4b9adb1057497401e38b602de9cb10 /subsonic-android | |
parent | 188647e6ebc0f0065bf8c5f0aa04c2cf7370c8cb (diff) | |
download | dsub-a90c77104abca83bce2623170e1b050b76da2045.tar.gz dsub-a90c77104abca83bce2623170e1b050b76da2045.tar.bz2 dsub-a90c77104abca83bce2623170e1b050b76da2045.zip |
Moved addToPlaylist next to other playlist functions
Diffstat (limited to 'subsonic-android')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/service/MusicService.java | 4 | ||||
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java | 34 |
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()); |