[Android] Use Artist for media description

Geoffrey Métais git at videolan.org
Thu Jun 1 15:51:13 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jun  1 15:49:38 2017 +0200| [cae2fff78cee18a37ab4676d5a89e88124d08c69] | committer: Geoffrey Métais

Use Artist for media description

We used to display albumArtist when available, which is irrelevant.
Thus, this patch inverts the artist/album position, artist is now
displayed first.

Close #224

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

 .../src/org/videolan/medialibrary/media/MediaWrapper.java  | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/medialibrary/src/org/videolan/medialibrary/media/MediaWrapper.java b/medialibrary/src/org/videolan/medialibrary/media/MediaWrapper.java
index 2c6968c98..8eb1b0357 100644
--- a/medialibrary/src/org/videolan/medialibrary/media/MediaWrapper.java
+++ b/medialibrary/src/org/videolan/medialibrary/media/MediaWrapper.java
@@ -136,15 +136,15 @@ public class MediaWrapper extends MediaLibraryItem implements Parcelable {
         init(time, length, type, null, title, artist, genre, album, albumArtist, width, height, artworkURL != null ? VLCUtil.UriFromMrl(artworkURL).getPath() : null, audio, spu, trackNumber, discNumber, lastModified, null);
         sb.setLength(0);
         if (type == TYPE_AUDIO) {
-            String artistMeta = getReferenceArtist();
-            boolean hasArtistMeta = !TextUtils.isEmpty(artistMeta);
-            if (!TextUtils.isEmpty(album)) {
-                sb.append(album);
-                if (hasArtistMeta)
+            boolean hasArtistMeta = !TextUtils.isEmpty(artist);
+            boolean hasAlbumMeta = !TextUtils.isEmpty(album);
+            if (hasArtistMeta) {
+                sb.append(artist);
+                if (hasAlbumMeta)
                     sb.append(" - ");
             }
-            if (hasArtistMeta)
-                sb.append(artistMeta);
+            if (hasAlbumMeta)
+                sb.append(album);
         } else if (type == TYPE_VIDEO) {
             Tools.setMediaDescription(this);
         }



More information about the Android mailing list