[Android] Fix playlist's trackscount not updated after deleting track(s)

tda1009 git at videolan.org
Thu Sep 3 09:12:48 CEST 2020


vlc-android | branch: master | tda1009 <turboeighteen at gmail.com> | Wed Sep  2 17:14:37 2020 +0700| [a1b800c67dfa99bfb550f14178b1636100ca9562] | committer: tda1009

Fix playlist's trackscount not updated after deleting track(s)

> https://code.videolan.org/videolan/vlc-android/commit/a1b800c67dfa99bfb550f14178b1636100ca9562
---

 .../vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt
index 28a5ecaa0..3ac819864 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt
@@ -47,6 +47,7 @@ import org.videolan.libvlc.util.AndroidUtil
 import org.videolan.medialibrary.interfaces.media.Artist
 import org.videolan.medialibrary.media.MediaLibraryItem
 import org.videolan.medialibrary.media.MediaLibraryItem.FLAG_SELECTED
+import org.videolan.medialibrary.media.MediaLibraryItem.TYPE_PLAYLIST
 import org.videolan.resources.AppContextProvider
 import org.videolan.resources.UPDATE_SELECTION
 import org.videolan.resources.interfaces.FocusListener
@@ -360,7 +361,7 @@ class AudioBrowserAdapter @JvmOverloads constructor(
                     oldMedia: MediaLibraryItem, newMedia: MediaLibraryItem): Boolean {
                 return if (preventNextAnim) {
                     true
-                } else oldMedia === newMedia || oldMedia.itemType == newMedia.itemType && oldMedia.equals(newMedia)
+                } else oldMedia === newMedia || oldMedia.itemType == newMedia.itemType && oldMedia.tracksCount == newMedia.tracksCount && oldMedia.equals(newMedia)
             }
 
             override fun areContentsTheSame(



More information about the Android mailing list