Remove getAbsoluteUrl method

This commit is contained in:
len
2016-06-18 17:37:41 +02:00
parent 9beeca652f
commit 585f7ec17d
6 changed files with 43 additions and 63 deletions

View File

@@ -1,5 +1,8 @@
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? {
@@ -10,3 +13,10 @@ fun Element.selectInt(css: String, defaultValue: Int = 0): Int {
return select(css).first()?.text()?.toInt() ?: defaultValue
}
/**
* 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())
}