[Android] Set title for all unknown albums

Geoffrey Métais git at videolan.org
Tue Jan 17 12:03:55 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jan 17 12:03:12 2017 +0100| [f2b8242b81baf20a39ed3818ae3f8218a8064bb5] | committer: Geoffrey Métais

Set title for all unknown albums

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

 .../src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java       | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java
index a23f867..968e454 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java
@@ -209,8 +209,9 @@ public class AudioBrowserAdapter extends BaseAdapter<AudioBrowserAdapter.ViewHol
         if (mContext == null)
             return;
         mDataList = generateSections ? generateList(items) : items;
-        int count = Math.min(3, getItemCount());
-        for (int i = 0; i<count; ++i) {
+        for (int i = 0; i<getItemCount(); ++i) {
+            if (mDataList[i].getItemType() == MediaLibraryItem.TYPE_DUMMY)
+                continue;
             if (mDataList[i].getTitle().isEmpty()) {
                 if (mDataList[i].getItemType() == MediaLibraryItem.TYPE_ARTIST) {
                     if (mDataList[i].getId() == 1L)
@@ -219,7 +220,8 @@ public class AudioBrowserAdapter extends BaseAdapter<AudioBrowserAdapter.ViewHol
                         mDataList[i].setTitle(mContext.getString(R.string.various_artists));
                 } else if (mDataList[i].getItemType() == MediaLibraryItem.TYPE_ALBUM)
                     mDataList[i].setTitle(mContext.getString(R.string.unknown_album));
-            }
+            } else
+                break;
         }
     }
 



More information about the Android mailing list