aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2014-06-18 15:17:31 -0700
committerdaneren2005 <daneren2005@gmail.com>2014-06-18 15:17:31 -0700
commita10d27d2b3d6e1eab99d1cbc4a13d14653a4c3c1 (patch)
treed31704204cf92686d9ac41fbe9ffb0391e59f053
parent837c6dd07f0cb2ac9b01603969637fed464ae29a (diff)
downloaddsub-a10d27d2b3d6e1eab99d1cbc4a13d14653a4c3c1.tar.gz
dsub-a10d27d2b3d6e1eab99d1cbc4a13d14653a4c3c1.tar.bz2
dsub-a10d27d2b3d6e1eab99d1cbc4a13d14653a4c3c1.zip
Remove non-owned public playlists from Add To Playlist dialog
-rw-r--r--src/github/daneren2005/dsub/fragments/SubsonicFragment.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
index 3c2f1f54..62028666 100644
--- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
@@ -788,7 +788,18 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
@Override
protected List<Playlist> doInBackground() throws Throwable {
MusicService musicService = MusicServiceFactory.getMusicService(context);
- return musicService.getPlaylists(false, context, this);
+ List<Playlist> playlists = musicService.getPlaylists(false, context, this);
+
+ // Iterate through and remove all non owned public playlists
+ Iterator<Playlist> it = playlists.iterator();
+ while(it.hasNext()) {
+ Playlist playlist = it.next();
+ if(playlist.getPublic() == true && !UserUtil.getCurrentUsername(context).equals(playlist.getOwner)) {
+ it.remove();
+ }
+ }
+
+ return playlists;
}
@Override