mirror of
https://github.com/videolan/vlc-android
synced 2024-11-23 09:56:36 +08:00
OpenSubtitles: fix some crash due to incorrect casting
This commit is contained in:
parent
8e01b6314f
commit
4412753cb3
@ -63,7 +63,7 @@ data class Attributes(
|
||||
@field:Json(name = "new_download_count")
|
||||
val newDownloadCount: Int?,
|
||||
@field:Json(name = "ratings")
|
||||
val ratings: Int = 0,
|
||||
val ratings: Float = 0F,
|
||||
@field:Json(name = "related_links")
|
||||
val relatedLinks: List<RelatedLink?>?,
|
||||
@field:Json(name = "release")
|
||||
@ -93,7 +93,7 @@ data class FeatureDetails(
|
||||
@field:Json(name = "imdb_id")
|
||||
val imdbId: Int?,
|
||||
@field:Json(name = "movie_name")
|
||||
val movieName: String?,
|
||||
val movieName: String,
|
||||
@field:Json(name = "parent_feature_id")
|
||||
val parentFeatureId: Int?,
|
||||
@field:Json(name = "parent_imdb_id")
|
||||
|
@ -12,7 +12,7 @@ data class SubtitleItem(
|
||||
val state: State,
|
||||
var zipDownloadLink: String,
|
||||
val hearingImpaired: Boolean,
|
||||
val rating: Int,
|
||||
val rating: Float,
|
||||
val downloadNumber: Long,
|
||||
var fileName: String = ""
|
||||
) {
|
||||
|
@ -98,7 +98,7 @@ class SubtitlesModel(private val context: Context, private val mediaUri: Uri, pr
|
||||
|
||||
private val apiResultLiveData: MutableLiveData<List<Data>> = MutableLiveData()
|
||||
private val downloadedLiveData = ExternalSubRepository.getInstance(context).getDownloadedSubtitles(mediaUri).map { list ->
|
||||
list.map { SubtitleItem(it.idSubtitle, -1, mediaUri, it.subLanguageID, it.movieReleaseName, State.Downloaded, "", it.hearingImpaired, 0, 0) }
|
||||
list.map { SubtitleItem(it.idSubtitle, -1, mediaUri, it.subLanguageID, it.movieReleaseName, State.Downloaded, "", it.hearingImpaired, 0F, 0) }
|
||||
}
|
||||
|
||||
private val downloadingLiveData = ExternalSubRepository.getInstance(context).downloadingSubtitles
|
||||
@ -164,7 +164,7 @@ class SubtitlesModel(private val context: Context, private val mediaUri: Uri, pr
|
||||
openSubtitle.attributes.files.first().fileId,
|
||||
mediaUri,
|
||||
openSubtitle.attributes.language,
|
||||
openSubtitle.attributes.featureDetails.title,
|
||||
openSubtitle.attributes.featureDetails.movieName,
|
||||
state,
|
||||
"",
|
||||
openSubtitle.attributes.hearingImpaired,
|
||||
|
Loading…
Reference in New Issue
Block a user