mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-05-02 14:54:25 +02:00
fix: import bundles on another thread
This commit is contained in:
parent
1ce56af3b1
commit
d8248cc915
@ -137,7 +137,7 @@ class PatchBundleRepository(
|
|||||||
private fun addBundle(patchBundle: PatchBundleSource) =
|
private fun addBundle(patchBundle: PatchBundleSource) =
|
||||||
_sources.update { it.toMutableMap().apply { put(patchBundle.uid, patchBundle) } }
|
_sources.update { it.toMutableMap().apply { put(patchBundle.uid, patchBundle) } }
|
||||||
|
|
||||||
suspend fun createLocal(patches: InputStream, integrations: InputStream?) {
|
suspend fun createLocal(patches: InputStream, integrations: InputStream?) = withContext(Dispatchers.Default) {
|
||||||
val uid = persistenceRepo.create("", SourceInfo.Local).uid
|
val uid = persistenceRepo.create("", SourceInfo.Local).uid
|
||||||
val bundle = LocalPatchBundle("", uid, directoryOf(uid))
|
val bundle = LocalPatchBundle("", uid, directoryOf(uid))
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ class PatchBundleRepository(
|
|||||||
addBundle(bundle)
|
addBundle(bundle)
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun createRemote(url: String, autoUpdate: Boolean) {
|
suspend fun createRemote(url: String, autoUpdate: Boolean) = withContext(Dispatchers.Default) {
|
||||||
val entity = persistenceRepo.create("", SourceInfo.from(url), autoUpdate)
|
val entity = persistenceRepo.create("", SourceInfo.from(url), autoUpdate)
|
||||||
addBundle(entity.load())
|
addBundle(entity.load())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user