From 1f56d0c12edf043ca8bd15a5cd899a7503c5b2d4 Mon Sep 17 00:00:00 2001 From: LagradOst <11805592+LagradOst@users.noreply.github.com> Date: Thu, 26 May 2022 20:08:32 +0200 Subject: [PATCH] fixed selecting lang 1 instead of lang --- .../com/lagradost/cloudstream3/ui/player/GeneratorPlayer.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/player/GeneratorPlayer.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/player/GeneratorPlayer.kt index e5913f1b..46bd6cbc 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/player/GeneratorPlayer.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/player/GeneratorPlayer.kt @@ -480,7 +480,8 @@ class GeneratorPlayer : FullScreenPlayer() { if (settings) subtitles.firstOrNull { sub -> - sub.name.replace(Regex("[^A-Za-z]")," ").startsWith("$lang ") + val t = sub.name.replace(Regex("[^A-Za-z]"), " ").trim() + t == lang || t.startsWith("$lang ") || sub.name.trim() == langCode }?.let { sub -> return sub