[Android] Remove media from playlist only if necessary

Geoffrey Métais git at videolan.org
Thu Mar 19 18:32:40 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Mar 19 18:13:33 2015 +0100| [aeebf30cd7e3da9518e1f57ff0c7ecfe91c83eeb] | committer: Geoffrey Métais

Remove media from playlist only if necessary

Fixes #13989

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=aeebf30cd7e3da9518e1f57ff0c7ecfe91c83eeb
---

 .../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java        |    3 ++-
 vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java   |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
index d9eb439..aed5707 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -391,7 +391,8 @@ public class AudioBrowserFragment extends BrowserFragment implements SwipeRefres
                             AudioBrowserListAdapter.ListItem listItem = (AudioBrowserListAdapter.ListItem)o;
                             MediaWrapper media = listItem.mMediaList.get(0);
                             mMediaLibrary.getMediaItems().remove(media);
-                            mAudioController.removeLocation(media.getLocation());
+                            if (mAudioController.getMediaLocations().contains(media.getLocation()))
+                                mAudioController.removeLocation(media.getLocation());
                             updateLists();
                         }
                     });
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index 06c80d4..5dd04f0 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -324,7 +324,8 @@ public class VideoGridFragment extends BrowserFragment implements ISortable, IVi
                             MediaWrapper media = (MediaWrapper) o;
                             mMediaLibrary.getMediaItems().remove(media);
                             mVideoAdapter.remove(media);
-                            mAudioController.removeLocation(media.getLocation());
+                            if (mAudioController.getMediaLocations().contains(media.getLocation()))
+                                mAudioController.removeLocation(media.getLocation());
                         }
                     });
             alertDialog.show();



More information about the Android mailing list