Fix the chapter title in the player

closes #2850
This commit is contained in:
Bnyro 2023-01-24 10:05:12 +01:00 committed by GitHub
parent 787bc1bfec
commit 20584f33b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1195,7 +1195,7 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
*/ */
private fun getCurrentChapterIndex(): Int? { private fun getCurrentChapterIndex(): Int? {
val currentPosition = exoPlayer.currentPosition / 1000 val currentPosition = exoPlayer.currentPosition / 1000
return chapters.indexOfFirst { currentPosition >= it.start!! }.takeIf { it >= 0 } return chapters.indexOfLast { currentPosition >= it.start!! }.takeIf { it >= 0 }
} }
private fun setMediaSource(uri: Uri, mimeType: String) { private fun setMediaSource(uri: Uri, mimeType: String) {