[Android] Set media subTitle nullable

Geoffrey Métais git at videolan.org
Mon Jul 16 10:21:44 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jul 13 10:57:51 2018 +0200| [73917d465b127a3ac8a9deb2807725e2a89d1d4b] | committer: Geoffrey Métais

Set media subTitle nullable

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

 vlc-android/src/org/videolan/vlc/media/MediaUtils.kt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/media/MediaUtils.kt b/vlc-android/src/org/videolan/vlc/media/MediaUtils.kt
index f412e172f..46e0cbc0e 100644
--- a/vlc-android/src/org/videolan/vlc/media/MediaUtils.kt
+++ b/vlc-android/src/org/videolan/vlc/media/MediaUtils.kt
@@ -189,16 +189,16 @@ object MediaUtils {
         return genre ?: getMediaString(ctx, R.string.unknown_genre)
     }
 
-    fun getMediaSubtitle(media: MediaWrapper): String {
+    fun getMediaSubtitle(media: MediaWrapper): String? {
         var subtitle = if (media.nowPlaying != null)
             media.nowPlaying
         else
             media.artist
         if (media.length > 0L) {
-            if (TextUtils.isEmpty(subtitle))
-                subtitle = Tools.millisToString(media.length)
+            subtitle = if (TextUtils.isEmpty(subtitle))
+                Tools.millisToString(media.length)
             else
-                subtitle = subtitle + "  -  " + Tools.millisToString(media.length)
+                subtitle + "  -  " + Tools.millisToString(media.length)
         }
         return subtitle
     }



More information about the Android mailing list