[Android] Add 'Unknown Artist' for unknown album

Geoffrey Métais git at videolan.org
Wed Jan 18 16:36:24 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jan 18 16:35:38 2017 +0100| [0052e596c0ae34acec7bb95683cb64d0d52566e7] | committer: Geoffrey Métais

Add 'Unknown Artist' for unknown album

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

 medialibrary/src/org/videolan/medialibrary/media/Album.java         | 2 +-
 vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/medialibrary/src/org/videolan/medialibrary/media/Album.java b/medialibrary/src/org/videolan/medialibrary/media/Album.java
index 6e8408f..7d2a6ac 100644
--- a/medialibrary/src/org/videolan/medialibrary/media/Album.java
+++ b/medialibrary/src/org/videolan/medialibrary/media/Album.java
@@ -29,7 +29,7 @@ public class Album extends MediaLibraryItem {
 
     @Override
     public String getDescription() {
-        return albumArtist;
+        return mDescription == null ? albumArtist : mDescription;
     }
 
     public int getReleaseYear() {
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 968e454..af24e9d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java
@@ -218,8 +218,11 @@ public class AudioBrowserAdapter extends BaseAdapter<AudioBrowserAdapter.ViewHol
                         mDataList[i].setTitle(mContext.getString(R.string.unknown_artist));
                     else if (mDataList[i].getId() == 2L)
                         mDataList[i].setTitle(mContext.getString(R.string.various_artists));
-                } else if (mDataList[i].getItemType() == MediaLibraryItem.TYPE_ALBUM)
+                } else if (mDataList[i].getItemType() == MediaLibraryItem.TYPE_ALBUM) {
                     mDataList[i].setTitle(mContext.getString(R.string.unknown_album));
+                    if (TextUtils.isEmpty(mDataList[i].getDescription()))
+                        mDataList[i].setDescription(mContext.getString(R.string.unknown_artist));
+                }
             } else
                 break;
         }



More information about the Android mailing list