priority manga update list

This commit is contained in:
Cuong-Tran 2025-02-19 12:00:00 +07:00
parent c2bfeb443d
commit d5f41b6c25
No known key found for this signature in database
GPG key ID: 733AA7624B9315C2

View file

@ -339,7 +339,21 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet
else -> true else -> true
} }
} }
.sortedBy { it.manga.title } .sortedWith(
compareByDescending<LibraryManga> {
// Prefer manga updating today
it.manga.nextUpdate <= fetchWindowUpperBound
}.thenByDescending {
// Prefer manga the user has started
it.lastRead > 0L
}.thenByDescending {
// Prefer manga that the user has most recently read
it.lastRead
}.thenByDescending {
// Default sorting
it.manga.title
},
)
notifier.showQueueSizeWarningNotificationIfNeeded(mangaToUpdate) notifier.showQueueSizeWarningNotificationIfNeeded(mangaToUpdate)