Option to import manga from directories #31

This commit is contained in:
Koitharu
2022-08-10 14:27:51 +03:00
parent 59a50e163f
commit 0077dc2f1c
33 changed files with 657 additions and 121 deletions

View File

@@ -25,7 +25,7 @@ inline fun <T> Set(size: Int, init: (index: Int) -> T): Set<T> = when (size) {
else -> MutableSet(size, init)
}
fun <T> List<T>.asArrayList(): ArrayList<T> = if (this is ArrayList<*>) {
fun <T> Collection<T>.asArrayList(): ArrayList<T> = if (this is ArrayList<*>) {
this as ArrayList<T>
} else {
ArrayList(this)
@@ -38,4 +38,4 @@ fun <K, V> Map<K, V>.findKeyByValue(value: V): K? {
}
}
return null
}
}

View File

@@ -1,3 +1,7 @@
package org.koitharu.kotatsu.utils.ext
inline fun Int.ifZero(defaultValue: () -> Int): Int = if (this == 0) defaultValue() else this
inline fun Int.ifZero(defaultValue: () -> Int): Int = if (this == 0) defaultValue() else this
fun longOf(a: Int, b: Int): Long {
return a.toLong() shl 32 or (b.toLong() and 0xffffffffL)
}