Group plugins by package
This commit is contained in:
@@ -36,6 +36,9 @@ interface PluginDao {
|
||||
@Update
|
||||
suspend fun update(plugin: PluginEntity)
|
||||
|
||||
@Update
|
||||
suspend fun updateMany(plugins: List<PluginEntity>)
|
||||
|
||||
@Query("DELETE FROM Plugins")
|
||||
suspend fun deleteMany()
|
||||
}
|
||||
@@ -360,6 +360,7 @@ internal class PluginFileDeserializer(
|
||||
val authority = obj.getString("authority")
|
||||
val id = obj.getString("id")
|
||||
val plugin = pluginRepository.get(authority).firstOrNull() ?: return null
|
||||
if (!plugin.enabled) return null
|
||||
val provider = PluginFileProvider(context, plugin)
|
||||
return provider.getFile(id)
|
||||
} catch (e: Exception) {
|
||||
|
||||
@@ -52,6 +52,14 @@ internal class PluginRepositoryImpl(
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateMany(plugins: List<Plugin>): Job {
|
||||
return scope.launch {
|
||||
dao.updateMany(
|
||||
plugins.map { PluginEntity(it) }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun deleteMany(): Job {
|
||||
return scope.launch {
|
||||
dao.deleteMany()
|
||||
|
||||
Reference in New Issue
Block a user