Skip to content

Commit

Permalink
fix: fix fonts not getting copied
Browse files Browse the repository at this point in the history
  • Loading branch information
abdallahmehiz committed Aug 8, 2024
1 parent 8cda9a0 commit 1a85d46
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 1a85d46

Please sign in to comment.