diff --git a/app/src/main/java/com/lagradost/cloudstream3/syncproviders/providers/OpenSubtitlesApi.kt b/app/src/main/java/com/lagradost/cloudstream3/syncproviders/providers/OpenSubtitlesApi.kt index f22fdd8b..d5d6400c 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/syncproviders/providers/OpenSubtitlesApi.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/syncproviders/providers/OpenSubtitlesApi.kt @@ -200,8 +200,12 @@ class OpenSubtitlesApi(index: Int) : InAppAuthAPIManager(index), AbstractSubApi it.data?.forEach { item -> val attr = item.attributes ?: return@forEach val featureDetails = attr.featDetails + //Use filename as name, if its valid + val filename = attr.files?.firstNotNullOfOrNull { subfile -> + subfile.fileName + } //Use any valid name/title in hierarchy - val name = featureDetails?.movieName ?: featureDetails?.title + val name = filename ?: featureDetails?.movieName ?: featureDetails?.title ?: featureDetails?.parentTitle ?: attr.release ?: "" val lang = fixLanguageReverse(attr.language)?: "" val resEpNum = featureDetails?.episodeNumber ?: query.epNumber @@ -330,4 +334,4 @@ class OpenSubtitlesApi(index: Int) : InAppAuthAPIManager(index), AbstractSubApi @JsonProperty("parent_tmdb_id") var parentTmdbId: Int? = null, @JsonProperty("parent_feature_id") var parentFeatureId: Int? = null ) -} \ No newline at end of file +}