Convert :source-api and :source-local to android library module (#3636)

- There's really no plan to support other platforms on this code base
- The "KMP" modules only had android target which is rather pointless
- `i18n` involves more work but given it has no actual code keeping it as is
This commit is contained in:
AntsyLich
2026-07-23 22:47:24 +06:00
committed by GitHub
parent 47d7c0f2ea
commit 9c3cc1ca5f
38 changed files with 54 additions and 128 deletions
@@ -0,0 +1,26 @@
package eu.kanade.tachiyomi.util
import okhttp3.Response
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
fun Element.selectText(css: String, defaultValue: String? = null): String? {
return select(css).first()?.text() ?: defaultValue
}
fun Element.selectInt(css: String, defaultValue: Int = 0): Int {
return select(css).first()?.text()?.toInt() ?: defaultValue
}
fun Element.attrOrText(css: String): String {
return if (css != "text") attr(css) else text()
}
/**
* Returns a Jsoup document for this response.
* @param html the body of the response. Use only if the body was read before calling this method.
*/
fun Response.asJsoup(html: String? = null): Document {
return Jsoup.parse(html ?: body.string(), request.url.toString())
}
@@ -0,0 +1,6 @@
package eu.kanade.tachiyomi.util
import rx.Observable
import tachiyomi.core.common.util.lang.awaitSingle
suspend fun <T> Observable<T>.awaitSingle(): T = awaitSingle()