From 1a85d460b8f4f2ad1acda703a430b0a6ed930d35 Mon Sep 17 00:00:00 2001 From: AbdallahMehiz Date: Thu, 8 Aug 2024 21:12:34 +0100 Subject: [PATCH] fix: fix fonts not getting copied --- app/src/main/java/live/mehiz/mpvkt/ui/player/PlayerActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/live/mehiz/mpvkt/ui/player/PlayerActivity.kt b/app/src/main/java/live/mehiz/mpvkt/ui/player/PlayerActivity.kt index 1851c0e..29ee759 100644 --- a/app/src/main/java/live/mehiz/mpvkt/ui/player/PlayerActivity.kt +++ b/app/src/main/java/live/mehiz/mpvkt/ui/player/PlayerActivity.kt @@ -277,7 +277,7 @@ class PlayerActivity : AppCompatActivity() { } DocumentFile.fromTreeUri(this, Uri.parse(subtitlesPreferences.fontsFolder.get()))?.listFiles()?.forEach { if (it.isDirectory || fontsDir.findFile(it.name!!)?.exists() == true) return@forEach - if (!it.name!!.endsWith("ttf", true) || !it.name!!.endsWith("otf")) return@forEach + if (!".*\\.[ot]tf$".toRegex().matches(it.name!!.lowercase())) return@forEach val input = contentResolver.openInputStream(it.uri) input!!.copyTo(File("$cachePath/fonts/${it.name}").outputStream()) input.close()