[Android] do not use metadata for videos

Sébastien Toque git at videolan.org
Fri Dec 7 21:51:32 CET 2012


vlc-ports/android | branch: master | Sébastien Toque <xilasz at gmail.com> | Thu Dec  6 23:06:48 2012 +0100| [fa828977f931a0e2f2c0ab9e73d227bc2eaa9bba] | committer: Sébastien Toque

do not use metadata for videos

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

 vlc-android/src/org/videolan/vlc/AudioService.java            |    9 ++++-----
 vlc-android/src/org/videolan/vlc/Media.java                   |    6 +++++-
 vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java    |    2 +-
 vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java      |    2 +-
 .../src/org/videolan/vlc/gui/audio/AudioListAdapter.java      |    2 +-
 5 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/AudioService.java b/vlc-android/src/org/videolan/vlc/AudioService.java
index 6b1ae9a..ff28277 100644
--- a/vlc-android/src/org/videolan/vlc/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/AudioService.java
@@ -452,11 +452,10 @@ public class AudioService extends Service {
             .setLargeIcon(AudioUtil.getCover(this, mCurrentMedia, 64))
             .setContentTitle(mCurrentMedia.getTitle())
             .setTicker(mCurrentMedia.getTitle() + " - " + mCurrentMedia.getArtist())
-            .setContentText((Util.isJellyBeanOrLater() ? mCurrentMedia.getArtist()
-                    : mCurrentMedia.getArtist() + " - " + mCurrentMedia.getAlbum()))
-                    .setContentInfo(mCurrentMedia.getAlbum())
-                    .setAutoCancel(false)
-                    .setOngoing(true);
+            .setContentText(Util.isJellyBeanOrLater() ? mCurrentMedia.getArtist() : mCurrentMedia.getSubtitle())
+            .setContentInfo(mCurrentMedia.getAlbum())
+            .setAutoCancel(false)
+            .setOngoing(true);
 
             Intent notificationIntent = new Intent(this, AudioPlayerActivity.class);
             notificationIntent.setAction(Intent.ACTION_MAIN);
diff --git a/vlc-android/src/org/videolan/vlc/Media.java b/vlc-android/src/org/videolan/vlc/Media.java
index 0453778..7176344 100644
--- a/vlc-android/src/org/videolan/vlc/Media.java
+++ b/vlc-android/src/org/videolan/vlc/Media.java
@@ -314,7 +314,7 @@ public class Media implements Comparable<Media> {
     }
 
     public String getTitle() {
-        if (mTitle != null)
+        if (mTitle != null && mType != TYPE_VIDEO)
             return mTitle;
         else {
             int end = getFileName().lastIndexOf(".");
@@ -324,6 +324,10 @@ public class Media implements Comparable<Media> {
         }
     }
 
+    public String getSubtitle() {
+        return mType != TYPE_VIDEO ? mArtist + " - " + mAlbum : "";
+    }
+
     public String getArtist() {
         return mArtist;
     }
diff --git a/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java b/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java
index 4e41bf3..02e4dad 100644
--- a/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java
@@ -269,7 +269,7 @@ public class DirectoryAdapter extends BaseAdapter {
             Log.d(TAG, "Loading media " + selectedNode.name);
             Media m = new Media(getMediaLocation(position), false);
             holder.title.setText(m.getTitle());
-            holderText = m.getArtist() + " - " + m.getAlbum();
+            holderText = m.getSubtitle();
         } else
             holder.title.setText(selectedNode.getVisibleName());
 
diff --git a/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java b/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
index 845f582..37a84c0 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
@@ -99,7 +99,7 @@ public class HistoryAdapter extends BaseAdapter {
         Log.d(TAG, "Loading media position " + position + " - " + selected);
         Media m = new Media(selected, position);
         holder.title.setText(m.getTitle());
-        holderText = m.getArtist() + " - " + m.getAlbum();
+        holderText = m.getSubtitle();
 
         holder.text.setText(holderText);
         holder.icon.setImageResource(R.drawable.icon);
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioListAdapter.java
index 2d683c6..b9a18e7 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioListAdapter.java
@@ -109,7 +109,7 @@ public class AudioListAdapter extends ArrayAdapter<Media> {
                 ? R.color.list_title_last
                 : R.color.list_title);
         holder.title.setTextColor(titleColor);
-        holder.artist.setText(media.getArtist() + " - " + media.getAlbum());
+        holder.artist.setText(media.getSubtitle());
         return v;
     }
 



More information about the Android mailing list