parent
ef863335e6
commit
3634b52e3a
3 changed files with 18 additions and 2 deletions
|
@ -24,3 +24,9 @@ updates:
|
|||
SELECT *
|
||||
FROM updatesView
|
||||
WHERE dateUpload > :after;
|
||||
|
||||
getUpdatesByReadStatus:
|
||||
SELECT *
|
||||
FROM updatesView
|
||||
WHERE read = :read
|
||||
AND dateUpload > :after;
|
|
@ -16,7 +16,12 @@ class TachiyomiWidgetManager(
|
|||
) {
|
||||
|
||||
fun Context.init(scope: LifecycleCoroutineScope) {
|
||||
database.subscribeToList { updatesViewQueries.updates(after = UpdatesGridGlanceWidget.DateLimit.timeInMillis) }
|
||||
database.subscribeToList {
|
||||
updatesViewQueries.getUpdatesByReadStatus(
|
||||
read = false,
|
||||
after = UpdatesGridGlanceWidget.DateLimit.timeInMillis,
|
||||
)
|
||||
}
|
||||
.drop(1)
|
||||
.distinctUntilChanged()
|
||||
.onEach {
|
||||
|
|
|
@ -72,7 +72,12 @@ class UpdatesGridGlanceWidget : GlanceAppWidget() {
|
|||
|
||||
val processList = list
|
||||
?: Injekt.get<DatabaseHandler>()
|
||||
.awaitList { updatesViewQueries.updates(after = DateLimit.timeInMillis) }
|
||||
.awaitList {
|
||||
updatesViewQueries.getUpdatesByReadStatus(
|
||||
read = false,
|
||||
after = DateLimit.timeInMillis,
|
||||
)
|
||||
}
|
||||
val (rowCount, columnCount) = ids
|
||||
.flatMap { manager.getAppWidgetSizes(it) }
|
||||
.maxBy { it.height.value * it.width.value }
|
||||
|
|
Reference in a new issue