Skip to content

Commit

Permalink
fix(player): Episode progress not being saved (#1784)
Browse files Browse the repository at this point in the history
  • Loading branch information
perokhe authored Sep 19, 2024
1 parent da558e6 commit a119460
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,7 @@ class PlayerActivity : BaseActivity() {
val tracks = streams.subtitle.tracks.toList()
val preferredIndex = subtitleSelect.getPreferredSubtitleIndex(tracks)
?: let {
val mpvSub = player.tracks["sub"]?.firstOrNull { player.sid == it.mpvId }
val mpvSub = player.tracks["sub"]?.toTypedArray()?.firstOrNull { player.sid == it.mpvId }
mpvSub?.let {
streams.subtitle.tracks.indexOfFirst { it.url == mpvSub.mpvId.toString() }
}?.coerceAtLeast(0) ?: 0
Expand Down Expand Up @@ -1861,8 +1861,7 @@ class PlayerActivity : BaseActivity() {
MPVLib.command(arrayOf("audio-add", audio.url, "select", audio.url))
}
} ?: run {
val mpvAudio = player.tracks.getOrElse("audio") { emptyList() }
.firstOrNull { player.aid == it.mpvId }
val mpvAudio = player.tracks["audio"]?.toTypedArray()?.firstOrNull { player.aid == it.mpvId }
streams.audio.index = mpvAudio?.let {
streams.audio.tracks.indexOfFirst { it.url == mpvAudio.mpvId.toString() }
}?.coerceAtLeast(0) ?: 0
Expand Down

0 comments on commit a119460

Please sign in to comment.