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