2020-10-26 07:13:02 +01:00
|
|
|
package exh.recs
|
|
|
|
|
|
2022-07-03 19:37:27 +02:00
|
|
|
import eu.kanade.domain.manga.interactor.GetManga
|
2022-09-03 16:16:30 +02:00
|
|
|
import eu.kanade.domain.source.model.SourcePagingSourceType
|
2023-02-16 04:47:47 +01:00
|
|
|
import eu.kanade.tachiyomi.source.CatalogueSource
|
2020-10-26 07:13:02 +01:00
|
|
|
import eu.kanade.tachiyomi.source.model.FilterList
|
2022-12-01 05:05:11 +01:00
|
|
|
import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourceScreenModel
|
2022-07-03 05:52:03 +02:00
|
|
|
import kotlinx.coroutines.runBlocking
|
|
|
|
|
import uy.kohesive.injekt.Injekt
|
|
|
|
|
import uy.kohesive.injekt.api.get
|
2020-10-26 07:13:02 +01:00
|
|
|
|
2022-12-01 05:05:11 +01:00
|
|
|
class RecommendsScreenModel(
|
2022-07-03 05:52:03 +02:00
|
|
|
val mangaId: Long,
|
|
|
|
|
sourceId: Long,
|
2022-07-03 19:37:27 +02:00
|
|
|
private val getManga: GetManga = Injekt.get(),
|
2022-12-01 05:05:11 +01:00
|
|
|
) : BrowseSourceScreenModel(sourceId, null) {
|
2020-10-26 07:13:02 +01:00
|
|
|
|
2022-12-01 05:05:11 +01:00
|
|
|
val manga = runBlocking { getManga.await(mangaId) }!!
|
2022-08-31 20:41:35 +02:00
|
|
|
|
2022-09-03 16:16:30 +02:00
|
|
|
override fun createSourcePagingSource(query: String, filters: FilterList): SourcePagingSourceType {
|
2023-02-16 04:47:47 +01:00
|
|
|
return RecommendsPagingSource(source as CatalogueSource, manga)
|
2020-10-26 07:13:02 +01:00
|
|
|
}
|
|
|
|
|
}
|