mirror of
https://github.com/mihonapp/mihon.git
synced 2025-06-25 18:47:51 +02:00
Remove dependency injection from core module and data module from presentation-widget module
Includes side effects: - No longer need to restart app for user agent string change to take effect - parseAs extension function requires a Json instance in the calling context, which doesn't necessarily need to be the default one provided by Injekt
This commit is contained in:
@ -23,6 +23,7 @@ dependencies {
|
||||
implementation(project(":source-api"))
|
||||
implementation(project(":domain"))
|
||||
implementation(project(":core"))
|
||||
|
||||
api(libs.sqldelight.android.driver)
|
||||
api(libs.sqldelight.coroutines)
|
||||
api(libs.sqldelight.android.paging)
|
||||
|
@ -6,12 +6,32 @@ import tachiyomi.domain.updates.model.UpdatesWithRelations
|
||||
import tachiyomi.domain.updates.repository.UpdatesRepository
|
||||
|
||||
class UpdatesRepositoryImpl(
|
||||
val databaseHandler: DatabaseHandler,
|
||||
private val databaseHandler: DatabaseHandler,
|
||||
) : UpdatesRepository {
|
||||
|
||||
override suspend fun awaitWithRead(read: Boolean, after: Long): List<UpdatesWithRelations> {
|
||||
return databaseHandler.awaitList {
|
||||
updatesViewQueries.getUpdatesByReadStatus(
|
||||
read = read,
|
||||
after = after,
|
||||
mapper = updateWithRelationMapper,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun subscribeAll(after: Long): Flow<List<UpdatesWithRelations>> {
|
||||
return databaseHandler.subscribeToList {
|
||||
updatesViewQueries.updates(after, updateWithRelationMapper)
|
||||
}
|
||||
}
|
||||
|
||||
override fun subscribeWithRead(read: Boolean, after: Long): Flow<List<UpdatesWithRelations>> {
|
||||
return databaseHandler.subscribeToList {
|
||||
updatesViewQueries.getUpdatesByReadStatus(
|
||||
read = read,
|
||||
after = after,
|
||||
mapper = updateWithRelationMapper,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user