INNER CODE UNIT · Kotlin
convertSources
komikku-app/komikku · app/src/main/java/exh/debug/DebugFunctions.kt:216
private fun convertSources(from: Long, to: Long) {
runBlocking {
handler.await { ehQueries.migrateSource(to, from) }
}
}
/*fun copyEHentaiSavedSearchesToExhentai() {
runBlocking {
val source = sourceManager.get(EH_SOURCE_ID) as? CatalogueSource ?: return@runBlocking
val newSource = sourceManager.get(EXH_SOURCE_ID) as? CatalogueSource ?: return@runBlocking
val savedSearches = prefs.savedSearches().get().mapNotNull {
try {
val id = it.substringBefore(':').toLong()
if (id != source.id) return@mapNotNull null
Json.decodeFromString<JsonSavedSearch>(it.substringAfter(':'))
} catch (t: RuntimeException) {
// Load failed
xLogE("Failed to load saved search!", t)