Update ktor monorepo to v3 (major) (#146)

* Update ktor monorepo to v3

* Build fixes

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Syer10 <syer10@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2025-10-05 16:28:06 -04:00
committed by GitHub
parent 231d01301d
commit 06c96b1ab6
4 changed files with 5 additions and 5 deletions

View File

@@ -22,7 +22,7 @@ import com.apollographql.apollo.ApolloClient
import com.apollographql.apollo.api.Optional import com.apollographql.apollo.api.Optional
import io.ktor.client.request.HttpRequestBuilder import io.ktor.client.request.HttpRequestBuilder
import io.ktor.client.request.get import io.ktor.client.request.get
import io.ktor.client.statement.readBytes import io.ktor.client.statement.readRawBytes
import io.ktor.http.Url import io.ktor.http.Url
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow import kotlinx.coroutines.flow.flow
@@ -164,7 +164,7 @@ class ChapterRepositoryImpl(
): Flow<ByteArray> { ): Flow<ByteArray> {
val realUrl = Url("$serverUrl$url") val realUrl = Url("$serverUrl$url")
return flow { emit(http.get(realUrl, block).readBytes()) } return flow { emit(http.get(realUrl, block).readRawBytes()) }
} }
companion object { companion object {

View File

@@ -37,7 +37,7 @@ ksp = "2.2.20-2.0.3"
kotlinInject = "0.7.2" kotlinInject = "0.7.2"
# Network # Network
ktor = "2.3.12" ktor = "3.3.0"
apollo = "4.0.0" apollo = "4.0.0"
apolloKtor = "0.0.2" apolloKtor = "0.0.2"

View File

@@ -113,7 +113,7 @@ class TachideskPageLoader(
flow { flow {
val response = getChapterPages.asFlow(page.url) { val response = getChapterPages.asFlow(page.url) {
onDownload { bytesSentTotal, contentLength -> onDownload { bytesSentTotal, contentLength ->
page.progress.value = (bytesSentTotal.toFloat() / contentLength).coerceAtMost(1.0F) page.progress.value = (bytesSentTotal.toFloat() / (contentLength ?: Long.MAX_VALUE)).coerceAtMost(1.0F)
} }
} }

View File

@@ -212,7 +212,7 @@ class SettingsBackupViewModel(
) { ) {
onDownload { bytesSentTotal, contentLength -> onDownload { bytesSentTotal, contentLength ->
_creatingStatus.value = Status.InProgress( _creatingStatus.value = Status.InProgress(
(bytesSentTotal.toFloat() / contentLength) (bytesSentTotal.toFloat() / (contentLength ?: Long.MAX_VALUE))
.coerceAtMost(0.99F), .coerceAtMost(0.99F),
) )
} }