[Android] Add a log for when subtitles download fails
Nicolas Pomepuy
git at videolan.org
Fri Aug 7 11:02:47 CEST 2020
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Fri Aug 7 10:21:22 2020 +0200| [1f4be6f9857afb98ffcb4f59bb271feb4b863b3d] | committer: Nicolas Pomepuy
Add a log for when subtitles download fails
> https://code.videolan.org/videolan/vlc-android/commit/1f4be6f9857afb98ffcb4f59bb271feb4b863b3d
---
.../vlc-android/src/org/videolan/vlc/viewmodels/SubtitlesModel.kt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/application/vlc-android/src/org/videolan/vlc/viewmodels/SubtitlesModel.kt b/application/vlc-android/src/org/videolan/vlc/viewmodels/SubtitlesModel.kt
index 712f559c9..c7bddd1e7 100644
--- a/application/vlc-android/src/org/videolan/vlc/viewmodels/SubtitlesModel.kt
+++ b/application/vlc-android/src/org/videolan/vlc/viewmodels/SubtitlesModel.kt
@@ -5,6 +5,7 @@ import android.net.Uri
import android.text.Html
import android.text.SpannableString
import android.text.Spanned
+import android.util.Log
import androidx.core.text.HtmlCompat
import androidx.core.text.toSpanned
import androidx.databinding.Observable
@@ -163,6 +164,7 @@ class SubtitlesModel(private val context: Context, private val mediaUri: Uri, va
if (isActive) apiResultLiveData.postValue(subs)
if (subs.isEmpty()) observableMessage.set(context.getString(R.string.no_result))
} catch (e: Exception) {
+ Log.e("SubtitlesModel", e.message, e)
if (e is NoConnectivityException)
observableMessage.set(context.getString(R.string.no_internet_connection))
else
More information about the Android
mailing list