fix(library): Accidentally swap global open random manga with non-global

This commit is contained in:
Ahmad Ansori Palembani 2024-11-29 13:13:21 +07:00
parent a4a7f8fb6d
commit cf06ebdb8b
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
2 changed files with 8 additions and 2 deletions

View file

@ -521,9 +521,9 @@ open class LibraryController(
private fun openRandomManga(global: Boolean) {
val items = if (global) {
adapter.currentItems
} else {
presenter.allLibraryItems
} else {
adapter.currentItems
}.filter { (it is LibraryItem && !it.manga.isBlank() && !it.manga.isHidden() && (!it.manga.initialized || it.manga.unread > 0)) }
if (items.isNotEmpty()) {
val item = items.random() as LibraryItem