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