fix http headers for video player

This commit is contained in:
jmir1 2023-02-21 17:23:39 +01:00
parent 74f25ffb6d
commit 5b17b405ac
3 changed files with 12 additions and 23 deletions

View file

@ -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 {

View file

@ -103,11 +103,6 @@ class PlayerViewModel(
private val eventChannel = Channel<Event>()
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<Stamp>? {
val animeId = anime?.id ?: return null
val trackManager = Injekt.get<TrackManager>()
var malId: Long?
val episodeNumber = getCurrentEpisodeIndex() + 1

View file

@ -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