Remove a uneeded .asObservable call
This commit is contained in:
parent
6ea90d982d
commit
05793d8a60
@ -3,9 +3,9 @@ package exh.util
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import eu.kanade.tachiyomi.source.model.MangasPage
|
import eu.kanade.tachiyomi.source.model.MangasPage
|
||||||
import eu.kanade.tachiyomi.source.online.UrlImportableSource
|
import eu.kanade.tachiyomi.source.online.UrlImportableSource
|
||||||
|
import eu.kanade.tachiyomi.util.lang.runAsObservable
|
||||||
import exh.GalleryAddEvent
|
import exh.GalleryAddEvent
|
||||||
import exh.GalleryAdder
|
import exh.GalleryAdder
|
||||||
import kotlinx.coroutines.flow.flow
|
|
||||||
import rx.Observable
|
import rx.Observable
|
||||||
|
|
||||||
private val galleryAdder by lazy {
|
private val galleryAdder by lazy {
|
||||||
@ -18,12 +18,9 @@ private val galleryAdder by lazy {
|
|||||||
fun UrlImportableSource.urlImportFetchSearchManga(context: Context, query: String, fail: () -> Observable<MangasPage>): Observable<MangasPage> =
|
fun UrlImportableSource.urlImportFetchSearchManga(context: Context, query: String, fail: () -> Observable<MangasPage>): Observable<MangasPage> =
|
||||||
when {
|
when {
|
||||||
query.startsWith("http://") || query.startsWith("https://") -> {
|
query.startsWith("http://") || query.startsWith("https://") -> {
|
||||||
flow {
|
runAsObservable({
|
||||||
emit(
|
galleryAdder.addGallery(context, query, false, this@urlImportFetchSearchManga)
|
||||||
galleryAdder.addGallery(context, query, false, this@urlImportFetchSearchManga)
|
})
|
||||||
)
|
|
||||||
}
|
|
||||||
.asObservable()
|
|
||||||
.map { res ->
|
.map { res ->
|
||||||
MangasPage(
|
MangasPage(
|
||||||
(
|
(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user