diff options
6 files changed, 26 insertions, 6 deletions
diff --git a/subsonic-android/res/menu/select_artist_context.xml b/subsonic-android/res/menu/select_artist_context.xml index d1fdbb02..7f9db01a 100644 --- a/subsonic-android/res/menu/select_artist_context.xml +++ b/subsonic-android/res/menu/select_artist_context.xml @@ -24,10 +24,5 @@ <item android:id="@+id/artist_menu_pin" android:title="@string/common.pin" - /> - - <item - android:id="@+id/artist_menu_star" - android:title="@string/common.star"/> - + /> </menu> diff --git a/subsonic-android/res/values/strings.xml b/subsonic-android/res/values/strings.xml index b1dd39f0..fa632b24 100644 --- a/subsonic-android/res/values/strings.xml +++ b/subsonic-android/res/values/strings.xml @@ -45,6 +45,7 @@ <string name="menu.exit">Exit</string>
<string name="menu.settings">Settings</string>
<string name="menu.help">Help</string>
+ <string name="menu.add_playlist">Add To Playlist</string>
<string name="playlist.label">Playlists</string>
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java index 2ad4e2bb..01b73d85 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java @@ -164,6 +164,9 @@ public class SelectAlbumActivity extends SubsonicTabActivity { delete(); selectAll(false, false); return true; + case R.id.menu_add_playlist: + + return true; case R.id.menu_exit: intent = new Intent(this, MainActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); diff --git a/subsonic-android/src/github/daneren2005/dsub/service/MusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/MusicService.java index 15abbdf8..a675e2ea 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/MusicService.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/MusicService.java @@ -92,4 +92,6 @@ 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 updatePlaylist(String id, String name, String comment, 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/OfflineMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java index f574572d..f4a6bcf0 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java @@ -313,6 +313,11 @@ public class OfflineMusicService extends RESTMusicService { public void setStarred(String id, boolean starred, Context context, ProgressListener progressListener) throws Exception { throw new OfflineException("Starring not available in offline mode"); } + + @Override + public void updatePlaylist(String id, String name, String comment, List<MusicDirectory.Entry> toAdd, Context context, ProgressListener progressListener) throws Exception { + throw new OfflineException("Updating playlist not available in offline mode"); + } @Override public MusicDirectory getRandomSongs(int size, Context context, ProgressListener progressListener) throws Exception { diff --git a/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java index a993df0d..92348332 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java @@ -74,6 +74,7 @@ import github.daneren2005.dsub.domain.Indexes; import github.daneren2005.dsub.domain.JukeboxStatus; import github.daneren2005.dsub.domain.Lyrics; import github.daneren2005.dsub.domain.MusicDirectory; +import github.daneren2005.dsub.domain.MusicDirectory.Entry; import github.daneren2005.dsub.domain.MusicFolder; import github.daneren2005.dsub.domain.Playlist; import github.daneren2005.dsub.domain.SearchCritera; @@ -624,6 +625,19 @@ public class RESTMusicService implements MusicService { Util.close(reader); } } + + @Override + public void updatePlaylist(String id, String name, String comment, List<Entry> toAdd, Context context, ProgressListener progressListener) throws Exception { + List<String> names = Arrays.asList("playListID", "name", "comment"); + List<Object> values = Arrays.<Object>asList(id, name, comment); + checkServerVersion(context, "1.8", "Updating playlists is not supported."); + 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()); |