mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
enhance: Small optimization
This commit is contained in:
parent
17180187f6
commit
efd25f8445
1 changed files with 8 additions and 3 deletions
|
@ -103,14 +103,19 @@ class LocalSource(private val context: Context) : CatalogueSource, UnmeteredSour
|
|||
query: String,
|
||||
filters: FilterList,
|
||||
): MangasPage {
|
||||
val time =
|
||||
if (filters === latestFilters) System.currentTimeMillis() - LATEST_THRESHOLD else 0L
|
||||
val time = if (filters === latestFilters) {
|
||||
System.currentTimeMillis() - LATEST_THRESHOLD
|
||||
} else {
|
||||
0L
|
||||
}
|
||||
|
||||
var mangaDirs = getBaseDirectory().listFiles().orEmpty()
|
||||
.filter { it.isDirectory || !it.name.orEmpty().startsWith('.') }
|
||||
.distinctBy { it.name }
|
||||
.filter {
|
||||
if (time == 0L)
|
||||
if (time == 0L && query.isBlank())
|
||||
true
|
||||
else if (time == 0L)
|
||||
it.name.orEmpty().contains(query, ignoreCase = true)
|
||||
else
|
||||
it.lastModified() >= time
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue