3
3
Fork 1
mirror of https://github.com/recloudstream/cloudstream.git synced 2024-08-15 01:53:11 +00:00
This commit is contained in:
Luna712 2024-07-22 14:23:59 -06:00 committed by GitHub
parent 3141c9baf8
commit 284b7df4d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -28,6 +28,11 @@ object SubtitleUtils {
}
}
/**
* @param name the file name of the subtitle
* @param display the file name of the video
* @param cleanDisplay the cleanDisplayName of the video file name
*/
fun isMatchingSubtitle(
name: String,
display: String,
@ -36,7 +41,7 @@ object SubtitleUtils {
// Check if the file has a valid subtitle extension
val hasValidExtension = allowedExtensions.any { name.contains(it, ignoreCase = true) }
// Ensure the file name is not exactly the same as the display name
// We can't have the exact same file as a subtitle
val isNotDisplayName = !name.equals(display, ignoreCase = true)
// Check if the file name starts with a cleaned version of the display name