fix player issue and provider issue

This commit is contained in:
LagradOst 2021-06-17 00:43:13 +02:00
parent f1c563e3bc
commit 2fbdd058f4
3 changed files with 3 additions and 1 deletions

View file

@ -109,7 +109,7 @@ class MeloMovieProvider : MainAPI() {
val type = findUsingRegex("var posttype = ([0-9]*)")?.toInt() ?: return null val type = findUsingRegex("var posttype = ([0-9]*)")?.toInt() ?: return null
val titleInfo = document.selectFirst("div.movie_detail_title > div > div > h1") val titleInfo = document.selectFirst("div.movie_detail_title > div > div > h1")
val title = titleInfo.ownText() val title = titleInfo.ownText()
val year = titleInfo.selectFirst("> a").text().replace("(", "").replace(")", "").toIntOrNull() val year = titleInfo.selectFirst("> a")?.text()?.replace("(", "")?.replace(")", "")?.toIntOrNull()
val plot = document.selectFirst("div.col-lg-12 > p").text() val plot = document.selectFirst("div.col-lg-12 > p").text()
if (type == 1) { // MOVIE if (type == 1) { // MOVIE

View file

@ -39,6 +39,7 @@ suspend fun <T> safeApiCall(
Log.d("ApiError", "-------------------------------------------------------------------") Log.d("ApiError", "-------------------------------------------------------------------")
Log.d("ApiError", "safeApiCall: " + throwable.localizedMessage) Log.d("ApiError", "safeApiCall: " + throwable.localizedMessage)
Log.d("ApiError", "safeApiCall: " + throwable.message) Log.d("ApiError", "safeApiCall: " + throwable.message)
throwable.printStackTrace()
Log.d("ApiError", "-------------------------------------------------------------------") Log.d("ApiError", "-------------------------------------------------------------------")
when (throwable) { when (throwable) {
/*is HttpException -> { /*is HttpException -> {

View file

@ -1075,6 +1075,7 @@ class PlayerFragment : Fragment() {
sources.indexOf(getCurrentUrl())) { _, which -> sources.indexOf(getCurrentUrl())) { _, which ->
//val speed = speedsText[which] //val speed = speedsText[which]
//Toast.makeText(requireContext(), "$speed selected.", Toast.LENGTH_SHORT).show() //Toast.makeText(requireContext(), "$speed selected.", Toast.LENGTH_SHORT).show()
playbackPosition = if(this::exoPlayer.isInitialized) exoPlayer.currentPosition else 0
setMirrorId(sources[which].getId()) setMirrorId(sources[which].getId())
initPlayer(getCurrentUrl()) initPlayer(getCurrentUrl())