Add weather plugin specific settings

This commit is contained in:
MM20
2023-12-29 17:50:55 +01:00
parent f984f68b34
commit 35ff1bce1a
8 changed files with 145 additions and 5 deletions
@@ -25,7 +25,7 @@ interface PluginDao {
): Flow<List<PluginEntity>>
@Query("SELECT * FROM Plugins WHERE authority = :authority")
fun get(authority: String): Flow<PluginEntity>
fun get(authority: String): Flow<PluginEntity?>
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insertMany(plugins: List<PluginEntity>)
@@ -31,7 +31,7 @@ internal class PluginRepositoryImpl(
}
override fun get(authority: String): Flow<Plugin?> {
return dao.get(authority).map { Plugin(it) }
return dao.get(authority).map { it?.let { Plugin(it) } }
}
override fun insertMany(plugins: List<Plugin>): Job {