[Android] SubtitleDownload: open to more subtitle extensions

Duncan McNamara git at videolan.org
Fri Feb 25 06:39:16 UTC 2022


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Wed Feb 16 15:09:22 2022 +0100| [66357e8cf75b85421eeebdae39626979bcebe2c7] | committer: Nicolas Pomepuy

SubtitleDownload: open to more subtitle extensions

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

 .../vlc-android/src/org/videolan/vlc/util/VLCDownloadManager.kt        | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/util/VLCDownloadManager.kt b/application/vlc-android/src/org/videolan/vlc/util/VLCDownloadManager.kt
index 871c5cd8c..f2eb6ae41 100644
--- a/application/vlc-android/src/org/videolan/vlc/util/VLCDownloadManager.kt
+++ b/application/vlc-android/src/org/videolan/vlc/util/VLCDownloadManager.kt
@@ -16,6 +16,7 @@ import androidx.lifecycle.ProcessLifecycleOwner
 import kotlinx.coroutines.CompletableDeferred
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.withContext
+import org.videolan.libvlc.util.Extensions
 import org.videolan.resources.AppContextProvider
 import org.videolan.tools.isStarted
 import org.videolan.vlc.R
@@ -84,7 +85,7 @@ object VLCDownloadManager: BroadcastReceiver(), LifecycleObserver {
         subtitleItem.run {
             ExternalSubRepository.getInstance(context).removeDownloadingItem(id)
             downloadedPaths.forEach {
-                if (it.endsWith(".srt"))
+                if (Extensions.SUBTITLES.contains(".${it.split('.').last()}"))
                     ExternalSubRepository.getInstance(context).saveDownloadedSubtitle(idSubtitle, it, mediaUri.path!!, subLanguageID, movieReleaseName)
             }
             withContext(Dispatchers.IO) { FileUtils.deleteFile(localUri) }



More information about the Android mailing list