diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-03-31 21:35:36 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-03-31 21:35:36 -0700 |
commit | b3841c04a7961cac98a8ec0e63e07d0613d7a08d (patch) | |
tree | 8a20af184cb4df72907e8a990bfdbf0b002dd230 | |
parent | ad6f8cccb59632110076d4c7d1b5b9add9603734 (diff) | |
download | dsub-b3841c04a7961cac98a8ec0e63e07d0613d7a08d.tar.gz dsub-b3841c04a7961cac98a8ec0e63e07d0613d7a08d.tar.bz2 dsub-b3841c04a7961cac98a8ec0e63e07d0613d7a08d.zip |
Put back others
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index 8ce9d6d5..d6f35479 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -158,10 +158,10 @@ public class SelectDirectoryFragment extends LibraryFunctionsFragment implements selectAll(false, false);
return true;
case R.id.menu_add_playlist:
- // addToPlaylist(getSelectedSongs());
+ addToPlaylist(getSelectedSongs());
return true;
case R.id.menu_remove_playlist:
- // removeFromPlaylist(playlistId, playlistName, getSelectedIndexes());
+ removeFromPlaylist(playlistId, playlistName, getSelectedIndexes());
return true;
}
@@ -541,6 +541,39 @@ public class SelectDirectoryFragment extends LibraryFunctionsFragment implements }
}
+ public void removeFromPlaylist(final String id, final String name, final List<Integer> indexes) {
+ /*new LoadingTask<Void>(this, true) {
+ @Override
+ protected Void doInBackground() throws Throwable {
+ MusicService musicService = MusicServiceFactory.getMusicService(SelectAlbumActivity.this);
+ musicService.removeFromPlaylist(id, indexes, SelectAlbumActivity.this, null);
+ return null;
+ }
+
+ @Override
+ protected void done(Void result) {
+ for(int i = indexes.size() - 1; i >= 0; i--) {
+ entryList.setItemChecked(indexes.get(i) + 1, false);
+ entryAdapter.removeAt(indexes.get(i));
+ }
+ entryAdapter.notifyDataSetChanged();
+ Util.toast(SelectAlbumActivity.this, getResources().getString(R.string.removed_playlist, indexes.size(), name));
+ }
+
+ @Override
+ protected void error(Throwable error) {
+ String msg;
+ if (error instanceof OfflineException || error instanceof ServerTooOldException) {
+ msg = getErrorMessage(error);
+ } else {
+ msg = getResources().getString(R.string.updated_playlist_error, name) + " " + getErrorMessage(error);
+ }
+
+ Util.toast(SelectAlbumActivity.this, msg, false);
+ }
+ }.execute();*/
+ }
+
private void checkLicenseAndTrialPeriod(Runnable onValid) {
if (licenseValid) {
onValid.run();
|