mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2025-12-10 06:42:05 +01:00
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:
@@ -22,7 +22,7 @@ import com.apollographql.apollo.ApolloClient
|
||||
import com.apollographql.apollo.api.Optional
|
||||
import io.ktor.client.request.HttpRequestBuilder
|
||||
import io.ktor.client.request.get
|
||||
import io.ktor.client.statement.readBytes
|
||||
import io.ktor.client.statement.readRawBytes
|
||||
import io.ktor.http.Url
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.flow
|
||||
@@ -164,7 +164,7 @@ class ChapterRepositoryImpl(
|
||||
): Flow<ByteArray> {
|
||||
val realUrl = Url("$serverUrl$url")
|
||||
|
||||
return flow { emit(http.get(realUrl, block).readBytes()) }
|
||||
return flow { emit(http.get(realUrl, block).readRawBytes()) }
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -37,7 +37,7 @@ ksp = "2.2.20-2.0.3"
|
||||
kotlinInject = "0.7.2"
|
||||
|
||||
# Network
|
||||
ktor = "2.3.12"
|
||||
ktor = "3.3.0"
|
||||
apollo = "4.0.0"
|
||||
apolloKtor = "0.0.2"
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ class TachideskPageLoader(
|
||||
flow {
|
||||
val response = getChapterPages.asFlow(page.url) {
|
||||
onDownload { bytesSentTotal, contentLength ->
|
||||
page.progress.value = (bytesSentTotal.toFloat() / contentLength).coerceAtMost(1.0F)
|
||||
page.progress.value = (bytesSentTotal.toFloat() / (contentLength ?: Long.MAX_VALUE)).coerceAtMost(1.0F)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ class SettingsBackupViewModel(
|
||||
) {
|
||||
onDownload { bytesSentTotal, contentLength ->
|
||||
_creatingStatus.value = Status.InProgress(
|
||||
(bytesSentTotal.toFloat() / contentLength)
|
||||
(bytesSentTotal.toFloat() / (contentLength ?: Long.MAX_VALUE))
|
||||
.coerceAtMost(0.99F),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user