Fix linting for JellyfinRepositoryImpl

This commit is contained in:
Efflam 2023-02-13 10:02:49 +01:00 committed by Sean Greenawalt
parent b7b92b9df5
commit d80568baa5

View file

@ -31,7 +31,6 @@ import io.ktor.utils.io.ByteReadChannel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.withContext
import org.jellyfin.sdk.api.client.exception.InvalidStatusException
import org.jellyfin.sdk.api.client.extensions.dynamicHlsApi
import org.jellyfin.sdk.api.client.extensions.get
import org.jellyfin.sdk.model.api.BaseItemDto
@ -358,10 +357,9 @@ class JellyfinRepositoryImpl(
return when (transcodeResolution) {
2160 -> 59616000 to 384000
1080 -> 14616000 to 384000
720 -> 7616000 to 384000
480 -> 2616000 to 384000
360 -> 292000 to 128000
720 -> 7616000 to 384000
480 -> 2616000 to 384000
360 -> 292000 to 128000
else -> null to null
}
}
@ -374,15 +372,14 @@ class JellyfinRepositoryImpl(
withContext(Dispatchers.IO) {
try {
val (videoBitRate, audioBitRate) = getVideoTranscodeBitRate(transcodeResolution)
if(videoBitRate == null || audioBitRate == null) {
if (videoBitRate == null || audioBitRate == null) {
jellyfinApi.api.dynamicHlsApi.getVariantHlsVideoPlaylistUrl(
itemId,
static = true,
mediaSourceId = mediaSourceId,
playSessionId = playSessionIds[itemId] // playSessionId is required to update the transcoding resolution
)
}
else {
} else {
jellyfinApi.api.dynamicHlsApi.getVariantHlsVideoPlaylistUrl(
itemId,
static = false,