Skip to content

Commit 81c7d90

Browse files
authored
Fix: Subtitle deletion matches on substring extension, can delete non-subtitle files (#2584)
1 parent 235863f commit 81c7d90

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/src/main/java/com/lagradost/cloudstream3/utils/SubtitleUtils.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ object SubtitleUtils {
4343
cleanDisplay: String
4444
): Boolean {
4545
// Check if the file has a valid subtitle extension
46-
val hasValidExtension = allowedExtensions.any { name.contains(it, ignoreCase = true) }
46+
val hasValidExtension = allowedExtensions.any { name.endsWith(it, ignoreCase = true) }
4747

4848
// We can't have the exact same file as a subtitle
4949
val isNotDisplayName = !name.equals(display, ignoreCase = true)
@@ -57,4 +57,4 @@ object SubtitleUtils {
5757
fun cleanDisplayName(name: String): String {
5858
return name.substringBeforeLast('.').trim()
5959
}
60-
}
60+
}

0 commit comments

Comments
 (0)