diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerActivity.kt index a1b831e36..f478325c0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerActivity.kt @@ -1426,10 +1426,10 @@ class PlayerActivity : val source = viewModel.source as AnimeHttpSource val headers = video.headers?.toMultimap() - ?.mapValues { it.value.getOrNull(0) ?: "" } + ?.mapValues { it.value.firstOrNull() ?: "" } ?.toMutableMap() ?: source.headers.toMultimap() - .mapValues { it.value.getOrNull(0) ?: "" } + .mapValues { it.value.firstOrNull() ?: "" } .toMutableMap() val httpHeaderString = headers.map { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerViewModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerViewModel.kt index 579b29348..64204b0dc 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerViewModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerViewModel.kt @@ -103,11 +103,6 @@ class PlayerViewModel( private val eventChannel = Channel() val eventFlow = eventChannel.receiveAsFlow() - /** - * The ID of the anime loaded in the player. - */ - var animeId: Long = -1L - /** * The anime loaded in the player. It can be null when instantiated for a short time. */ @@ -241,6 +236,7 @@ class PlayerViewModel( checkTrackers(anime) val source = sourceManager.getOrStub(anime.source) + this@PlayerViewModel.source = source episodeList = initEpisodeList() currentEpisode = episodeList.first { initialEpisodeId == it.id } @@ -668,8 +664,8 @@ class PlayerViewModel( * Returns the response of the AniSkipApi for this episode. * just works if tracking is enabled. */ - suspend fun aniSkipResponse(playerDuration: Int?): List? { + val animeId = anime?.id ?: return null val trackManager = Injekt.get() var malId: Long? val episodeNumber = getCurrentEpisodeIndex() + 1 diff --git a/gradle.properties b/gradle.properties index 87c9723c7..c3acc80b5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,24 +1,17 @@ -# Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. - -# For more details on how to configure your build environment visit +## For more details on how to configure your build environment visit # http://www.gradle.org/docs/current/userguide/build_environment.html - +# # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. -# Default value: -Xmx10248m -XX:MaxPermSize=256m +# Default value: -Xmx1024m -XX:MaxPermSize=256m # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -org.gradle.jvmargs=-Xmx5120m - +# # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -org.gradle.parallel=true - +# org.gradle.parallel=true +#Tue Feb 21 16:53:23 CET 2023 org.gradle.caching=true - -# AndroidX support +org.gradle.parallel=true +org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M" android.useAndroidX=true