Many small changes
- Remove unused gridlayout dependency - Add RECIEVE_BOOT permission for EH updater - Some suspending db IO calls
This commit is contained in:
@@ -1,21 +1,24 @@
|
||||
package exh.util
|
||||
|
||||
import android.database.Cursor
|
||||
import com.pushtorefresh.storio.operations.PreparedOperation
|
||||
import com.pushtorefresh.storio.sqlite.operations.get.PreparedGetCursor
|
||||
import com.pushtorefresh.storio.sqlite.operations.get.PreparedGetListOfObjects
|
||||
import com.pushtorefresh.storio.sqlite.operations.get.PreparedGetObject
|
||||
import com.pushtorefresh.storio.sqlite.operations.put.PreparedPutCollectionOfObjects
|
||||
import com.pushtorefresh.storio.sqlite.operations.put.PreparedPutObject
|
||||
import com.pushtorefresh.storio.sqlite.operations.put.PutResult
|
||||
import com.pushtorefresh.storio.sqlite.operations.put.PutResults
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
import eu.kanade.tachiyomi.util.lang.withIOContext
|
||||
|
||||
suspend fun <T> PreparedGetListOfObjects<T>.executeOnIO(): List<T> = withContext(Dispatchers.IO) { executeAsBlocking() }
|
||||
suspend fun <T> PreparedGetListOfObjects<T>.executeOnIO(): List<T> = withIOContext { executeAsBlocking() }
|
||||
|
||||
suspend fun <T> PreparedGetObject<T>.executeOnIO(): T? = withContext(Dispatchers.IO) { executeAsBlocking() }
|
||||
suspend fun <T> PreparedGetObject<T>.executeOnIO(): T? = withIOContext { executeAsBlocking() }
|
||||
|
||||
suspend fun <T> PreparedPutObject<T>.executeOnIO(): PutResult = withContext(Dispatchers.IO) { executeAsBlocking() }
|
||||
suspend fun <T> PreparedPutObject<T>.executeOnIO(): PutResult = withIOContext { executeAsBlocking() }
|
||||
|
||||
suspend fun <T> PreparedPutCollectionOfObjects<T>.executeOnIO(): PutResults<T> = withContext(Dispatchers.IO) { executeAsBlocking() }
|
||||
suspend fun <T> PreparedPutCollectionOfObjects<T>.executeOnIO(): PutResults<T> = withIOContext { executeAsBlocking() }
|
||||
|
||||
suspend fun <T> PreparedOperation<T>.executeOnIO(): T? = withContext(Dispatchers.IO) { executeAsBlocking() }
|
||||
suspend fun PreparedGetCursor.executeOnIO(): Cursor = withIOContext { executeAsBlocking() }
|
||||
|
||||
suspend fun <T> PreparedOperation<T>.executeOnIO(): T? = withIOContext { executeAsBlocking() }
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.jsoup.nodes.Document
|
||||
|
||||
fun Response.interceptAsHtml(block: (Document) -> Unit): Response {
|
||||
val body = body
|
||||
if (body?.contentType()?.type == "text" &&
|
||||
return if (body?.contentType()?.type == "text" &&
|
||||
body.contentType()?.subtype == "html"
|
||||
) {
|
||||
val bodyString = body.string()
|
||||
@@ -26,7 +26,6 @@ fun Response.interceptAsHtml(block: (Document) -> Unit): Response {
|
||||
close()
|
||||
}
|
||||
|
||||
return rebuiltResponse
|
||||
}
|
||||
return this
|
||||
rebuiltResponse
|
||||
} else this
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user