|
|
|
@ -70,13 +70,14 @@ class LocalMangaRepository @Inject constructor(private val storageManager: Local
|
|
|
|
if (!tags.isNullOrEmpty()) {
|
|
|
|
if (!tags.isNullOrEmpty()) {
|
|
|
|
list.retainAll { x -> x.containsTags(tags) }
|
|
|
|
list.retainAll { x -> x.containsTags(tags) }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@Suppress("NON_EXHAUSTIVE_WHEN_STATEMENT")
|
|
|
|
|
|
|
|
when (sortOrder) {
|
|
|
|
when (sortOrder) {
|
|
|
|
SortOrder.ALPHABETICAL -> list.sortWith(compareBy(AlphanumComparator()) { x -> x.manga.title })
|
|
|
|
SortOrder.ALPHABETICAL -> list.sortWith(compareBy(AlphanumComparator()) { x -> x.manga.title })
|
|
|
|
SortOrder.RATING -> list.sortByDescending { it.manga.rating }
|
|
|
|
SortOrder.RATING -> list.sortByDescending { it.manga.rating }
|
|
|
|
SortOrder.NEWEST,
|
|
|
|
SortOrder.NEWEST,
|
|
|
|
SortOrder.UPDATED,
|
|
|
|
SortOrder.UPDATED,
|
|
|
|
-> list.sortByDescending { it.createdAt }
|
|
|
|
-> list.sortByDescending { it.createdAt }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else -> Unit
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return list.unwrap()
|
|
|
|
return list.unwrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|