mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-24 21:58:34 +03:00
parent
aea88aa3b0
commit
2ab5b64796
3 changed files with 13 additions and 8 deletions
|
@ -1237,7 +1237,7 @@ class PlayerActivity :
|
|||
override fun onResume() {
|
||||
super.onResume()
|
||||
setVisibilities()
|
||||
if (deviceSupportsPip && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) player.paused?.let { updatePictureInPictureActions(!it) }
|
||||
if (deviceSupportsPip && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && isInPipMode) player.paused?.let { updatePictureInPictureActions(!it) }
|
||||
}
|
||||
|
||||
@Deprecated("Deprecated in Java")
|
||||
|
|
|
@ -647,7 +647,7 @@ class PlayerViewModel(
|
|||
val animeId = anime?.id ?: return null
|
||||
val trackManager = Injekt.get<TrackManager>()
|
||||
var malId: Long?
|
||||
val episodeNumber = getCurrentEpisodeIndex() + 1
|
||||
val episodeNumber = currentEpisode?.episode_number?.toInt() ?: return null
|
||||
if (getTracks.await(animeId).isEmpty()) {
|
||||
logcat { "AniSkip: No tracks found for anime $animeId" }
|
||||
return null
|
||||
|
|
|
@ -46,12 +46,17 @@ class AniSkipApi {
|
|||
Media(id:$id){idMal}
|
||||
}
|
||||
""".trimMargin()
|
||||
val response = client.newCall(
|
||||
POST(
|
||||
"https://graphql.anilist.co",
|
||||
body = buildJsonObject { put("query", query) }.toString().toRequestBody(jsonMime),
|
||||
),
|
||||
).execute()
|
||||
val response = try {
|
||||
client.newCall(
|
||||
POST(
|
||||
"https://graphql.anilist.co",
|
||||
body = buildJsonObject { put("query", query) }.toString()
|
||||
.toRequestBody(jsonMime),
|
||||
),
|
||||
).execute()
|
||||
} catch (e: Exception) {
|
||||
return 0
|
||||
}
|
||||
return response.body.string().substringAfter("idMal\":").substringBefore("}")
|
||||
.toLongOrNull() ?: 0
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue