Minor cleanup
This commit is contained in:
parent
59506d06f9
commit
d595a5ef82
@ -79,8 +79,6 @@ class UnsortedPreferences(
|
||||
"false,false,false,false,false,false,false,false,false,false",
|
||||
)
|
||||
|
||||
fun sourceSorting() = preferenceStore.getInt("sources_sort", 0)
|
||||
|
||||
fun enhancedEHentaiView() = preferenceStore.getBoolean("enhanced_e_hentai_view", true)
|
||||
|
||||
fun preferredMangaDexId() = preferenceStore.getString("preferred_mangaDex_id", "0")
|
||||
|
@ -223,8 +223,7 @@ class MangaDexAuthService(
|
||||
addQueryParameter("manga[]", it)
|
||||
}
|
||||
}
|
||||
.build()
|
||||
.toString(),
|
||||
.build(),
|
||||
getHeaders(),
|
||||
cache = CacheControl.FORCE_NETWORK,
|
||||
),
|
||||
|
@ -42,8 +42,7 @@ class MangaDexService(
|
||||
addQueryParameter("ids[]", it)
|
||||
}
|
||||
}
|
||||
.build()
|
||||
.toString(),
|
||||
.build(),
|
||||
cache = CacheControl.FORCE_NETWORK,
|
||||
),
|
||||
).await().parseAs(MdUtil.jsonParser)
|
||||
@ -62,8 +61,7 @@ class MangaDexService(
|
||||
addQueryParameter("includes[]", MdConstants.Types.author)
|
||||
addQueryParameter("includes[]", MdConstants.Types.artist)
|
||||
}
|
||||
.build()
|
||||
.toString(),
|
||||
.build(),
|
||||
cache = CacheControl.FORCE_NETWORK,
|
||||
),
|
||||
).await().parseAs(MdUtil.jsonParser)
|
||||
@ -81,8 +79,7 @@ class MangaDexService(
|
||||
addQueryParameter("manga[]", id)
|
||||
}
|
||||
}
|
||||
.build()
|
||||
.toString(),
|
||||
.build(),
|
||||
cache = CacheControl.FORCE_NETWORK,
|
||||
),
|
||||
).await().parseAs(MdUtil.jsonParser)
|
||||
@ -101,8 +98,7 @@ class MangaDexService(
|
||||
addPathSegment("aggregate")
|
||||
addQueryParameter("translatedLanguage[]", translatedLanguage)
|
||||
}
|
||||
.build()
|
||||
.toString(),
|
||||
.build(),
|
||||
cache = CacheControl.FORCE_NETWORK,
|
||||
),
|
||||
).await().parseAs(MdUtil.jsonParser)
|
||||
@ -140,7 +136,6 @@ class MangaDexService(
|
||||
}
|
||||
}
|
||||
.build()
|
||||
.toString()
|
||||
|
||||
return client.newCall(
|
||||
GET(
|
||||
@ -189,8 +184,7 @@ class MangaDexService(
|
||||
addPathSegment(id)
|
||||
addPathSegment("relation")
|
||||
}
|
||||
.build()
|
||||
.toString(),
|
||||
.build(),
|
||||
cache = CacheControl.FORCE_NETWORK,
|
||||
),
|
||||
).await().parseAs(MdUtil.jsonParser)
|
||||
|
@ -16,6 +16,7 @@ import eu.kanade.domain.UnsortedPreferences
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.databinding.EhActivityCaptchaBinding
|
||||
import eu.kanade.tachiyomi.network.NetworkHelper
|
||||
import eu.kanade.tachiyomi.network.POST
|
||||
import eu.kanade.tachiyomi.network.asObservableSuccess
|
||||
import eu.kanade.tachiyomi.network.parseAs
|
||||
import eu.kanade.tachiyomi.source.Source
|
||||
@ -33,7 +34,7 @@ import kotlinx.serialization.json.JsonObject
|
||||
import kotlinx.serialization.json.jsonArray
|
||||
import kotlinx.serialization.json.jsonObject
|
||||
import kotlinx.serialization.json.jsonPrimitive
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||
import okhttp3.MultipartBody
|
||||
import okhttp3.Request
|
||||
@ -301,15 +302,13 @@ class BrowserActionActivity : AppCompatActivity() {
|
||||
val audioFile = response.body.bytes()
|
||||
|
||||
httpClient.newCall(
|
||||
Request.Builder()
|
||||
.url(
|
||||
"https://stream.watsonplatform.net/speech-to-text/api/v1/recognize".toHttpUrlOrNull()!!
|
||||
POST(
|
||||
"https://stream.watsonplatform.net/speech-to-text/api/v1/recognize".toHttpUrl()
|
||||
.newBuilder()
|
||||
.addQueryParameter("watson-token", token)
|
||||
.build(),
|
||||
)
|
||||
.post(
|
||||
MultipartBody.Builder()
|
||||
.build()
|
||||
.toString(),
|
||||
body = MultipartBody.Builder()
|
||||
.setType(MultipartBody.FORM)
|
||||
.addFormDataPart("jsonDescription", RECOGNIZE_JSON)
|
||||
.addFormDataPart(
|
||||
@ -322,8 +321,7 @@ class BrowserActionActivity : AppCompatActivity() {
|
||||
),
|
||||
)
|
||||
.build(),
|
||||
)
|
||||
.build(),
|
||||
),
|
||||
).asObservableSuccess()
|
||||
}.map { response ->
|
||||
response.parseAs<JsonObject>()["results"]!!
|
||||
|
Loading…
x
Reference in New Issue
Block a user