Update build.grade and lint fixes

This commit is contained in:
Jobobby04 2020-05-05 14:27:28 -04:00
parent 730c316e89
commit c9a10d9033
3 changed files with 9 additions and 9 deletions

View File

@ -55,7 +55,7 @@ import okhttp3.Headers
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.Request import okhttp3.Request
import okhttp3.RequestBody import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.Response import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
@ -209,7 +209,7 @@ class EHentai(
d.select("#gdd .gdt1").find { el -> d.select("#gdd .gdt1").find { el ->
el.text().toLowerCase() == "posted:" el.text().toLowerCase() == "posted:"
}!!.nextElementSibling().text() }!!.nextElementSibling().text()
).time )!!.time
} }
// Build and append the rest of the galleries // Build and append the rest of the galleries
if (DebugToggles.INCLUDE_ONLY_ROOT_WHEN_LOADING_EXH_VERSIONS.enabled) listOf(self) if (DebugToggles.INCLUDE_ONLY_ROOT_WHEN_LOADING_EXH_VERSIONS.enabled) listOf(self)
@ -222,7 +222,7 @@ class EHentai(
this.url = EHentaiSearchMetadata.normalizeUrl(link) this.url = EHentaiSearchMetadata.normalizeUrl(link)
this.name = "v${index + 2}: $name" this.name = "v${index + 2}: $name"
this.chapter_number = index + 2f this.chapter_number = index + 2f
this.date_upload = EX_DATE_FORMAT.parse(posted).time this.date_upload = EX_DATE_FORMAT.parse(posted)!!.time
} }
}.reversed() + self }.reversed() + self
} }
@ -429,7 +429,7 @@ class EHentai(
left.removeSuffix(":") left.removeSuffix(":")
.toLowerCase() .toLowerCase()
) { ) {
"posted" -> datePosted = EX_DATE_FORMAT.parse(right).time "posted" -> datePosted = EX_DATE_FORMAT.parse(right)!!.time
// Example gallery with parent: https://e-hentai.org/g/1390451/7f181c2426/ // Example gallery with parent: https://e-hentai.org/g/1390451/7f181c2426/
// Example JP gallery: https://exhentai.org/g/1375385/03519d541b/ // Example JP gallery: https://exhentai.org/g/1375385/03519d541b/
// Parent is older variation of the gallery // Parent is older variation of the gallery
@ -601,7 +601,7 @@ class EHentai(
fun cookiesHeader(sp: Int = spPref().getOrDefault()) = buildCookies(rawCookies(sp)) fun cookiesHeader(sp: Int = spPref().getOrDefault()) = buildCookies(rawCookies(sp))
// Headers // Headers
override fun headersBuilder() = super.headersBuilder().add("Cookie", cookiesHeader())!! override fun headersBuilder() = super.headersBuilder().add("Cookie", cookiesHeader())
fun addParam(url: String, param: String, value: String) = Uri.parse(url) fun addParam(url: String, param: String, value: String) = Uri.parse(url)
.buildUpon() .buildUpon()
@ -619,7 +619,7 @@ class EHentai(
.build() .build()
chain.proceed(newReq) chain.proceed(newReq)
}.build()!! }.build()
// Filters // Filters
override fun getFilterList() = FilterList( override fun getFilterList() = FilterList(
@ -782,7 +782,7 @@ class EHentai(
client.newCall( client.newCall(
Request.Builder() Request.Builder()
.url(EH_API_BASE) .url(EH_API_BASE)
.post(RequestBody.create(JSON, json.toString())) .post(json.toString().toRequestBody(JSON))
.build() .build()
).execute().body!!.string() ).execute().body!!.string()
).obj ).obj

View File

@ -31,7 +31,7 @@ class SourceFilterSheet(
// EXH --> // EXH -->
onSaveClicked: () -> Unit, onSaveClicked: () -> Unit,
var onSavedSearchClicked: (Int) -> Unit = {}, var onSavedSearchClicked: (Int) -> Unit = {},
var onSavedSearchDeleteClicked: (Int, String) -> Unit = { index, name -> } var onSavedSearchDeleteClicked: (Int, String) -> Unit = { _, _ -> }
// EXH <-- // EXH <--
) : BottomSheetDialog(activity) { ) : BottomSheetDialog(activity) {

View File

@ -44,7 +44,7 @@ buildscript {
classpath("com.google.gms:google-services:4.3.3") classpath("com.google.gms:google-services:4.3.3")
classpath("com.google.android.gms:oss-licenses-plugin:0.10.2") classpath("com.google.android.gms:oss-licenses-plugin:0.10.2")
// Realm (EH) // Realm (EH)
classpath("io.realm:realm-gradle-plugin:5.13.1") classpath("io.realm:realm-gradle-plugin:6.0.2")
// Firebase (EH) // Firebase (EH)
classpath("io.fabric.tools:gradle:1.31.0") classpath("io.fabric.tools:gradle:1.31.0")