chore(db): Remove StorIO related stuff

This commit is contained in:
Ahmad Ansori Palembani 2024-11-30 17:27:20 +07:00
parent 844a83b4e1
commit a940722f2b
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
5 changed files with 1 additions and 31 deletions

View file

@ -212,10 +212,6 @@ dependencies {
// Database
implementation(libs.sqlite.android)
implementation(libs.bundles.sqlite)
//noinspection UseTomlInstead
implementation("com.github.inorichi.storio:storio-common:8be19de@aar")
//noinspection UseTomlInstead
implementation("com.github.inorichi.storio:storio-sqlite:8be19de@aar")
// Model View Presenter
implementation(libs.conductor)

View file

@ -12,14 +12,12 @@ class CategoriesBackupRestorer(
) {
suspend fun restoreCategories(backupCategories: List<BackupCategory>, onComplete: () -> Unit) {
// Get categories from file and from db
// Do it outside of transaction because StorIO might hang because we're using SQLDelight
val dbCategories = getCategories.await()
handler.await(true) {
// Iterate over them
backupCategories.map { it.getCategoryImpl() }.forEach { category ->
// Used to know if the category is already in the db
var found = false
for (dbCategory in dbCategories) {
for (dbCategory in getCategories.await()) {
// If the category is already in the db, assign the id to the file's category
// and do nothing
if (category.name == dbCategory.name) {

View file

@ -3,12 +3,6 @@ FIXME: Delete `search_metadata` from sqldelight migration
package eu.kanade.tachiyomi.data.database.queries
import com.pushtorefresh.storio.sqlite.queries.DeleteQuery
import com.pushtorefresh.storio.sqlite.queries.Query
import eu.kanade.tachiyomi.data.database.DbProvider
import eu.kanade.tachiyomi.data.database.models.SearchMetadata
import eu.kanade.tachiyomi.data.database.tables.SearchMetadataTable
interface SearchMetadataQueries : DbProvider {
fun getSearchMetadataForManga(mangaId: Long) = db.get()

View file

@ -133,7 +133,6 @@ class MigrationProcessAdapter(
sourceFinished()
}
// FIXME: Migrate to SQLDelight, on halt: in StorIO transaction
private suspend fun migrateMangaInternal(
prevSource: Source?,
source: Source,
@ -158,7 +157,6 @@ class MigrationProcessAdapter(
companion object {
// FIXME: Migrate to SQLDelight, on halt: in StorIO transaction
suspend fun migrateMangaInternal(
flags: Int,
enhancedServices: List<EnhancedTrackService>,

View file

@ -1,16 +0,0 @@
package eu.kanade.tachiyomi.util.system
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 kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
suspend fun <T> PreparedGetListOfObjects<T>.executeOnIO(): List<T> = withContext(Dispatchers.IO) { executeAsBlocking() }
suspend fun <T> PreparedGetObject<T>.executeOnIO(): T? = withContext(Dispatchers.IO) { executeAsBlocking() }
suspend fun <T> PreparedPutObject<T>.executeOnIO() = withContext(Dispatchers.IO) { executeAsBlocking() }
suspend fun <T> PreparedPutCollectionOfObjects<T>.executeOnIO() = withContext(Dispatchers.IO) { executeAsBlocking() }