Adapt source implementation for TachiyomiX 1.6 (#3243)

This commit is contained in:
AntsyLich
2026-06-14 02:34:31 +06:00
committed by GitHub
parent 430b13bb81
commit 4c37f4c764
38 changed files with 597 additions and 524 deletions
@@ -1,9 +1,12 @@
package tachiyomi.domain.source.model
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.model.SMangaUpdate
class StubSource(
override val id: Long,
@@ -13,11 +16,22 @@ class StubSource(
private val isInvalid: Boolean = name.isBlank() || lang.isBlank()
override suspend fun getMangaDetails(manga: SManga): SManga =
override val supportsLatest: Boolean = false
override suspend fun getPopularManga(page: Int): MangasPage = throw SourceNotInstalledException()
override suspend fun getLatestUpdates(page: Int): MangasPage = throw SourceNotInstalledException()
override suspend fun getSearchManga(page: Int, query: String, filters: FilterList): MangasPage =
throw SourceNotInstalledException()
override suspend fun getChapterList(manga: SManga): List<SChapter> =
throw SourceNotInstalledException()
override suspend fun getMangaUpdate(
manga: SManga,
chapters: List<SChapter>,
fetchDetails: Boolean,
fetchChapters: Boolean,
): SMangaUpdate = throw SourceNotInstalledException()
override suspend fun getPageList(chapter: SChapter): List<Page> =
throw SourceNotInstalledException()
@@ -1,6 +1,5 @@
package tachiyomi.domain.source.service
import eu.kanade.tachiyomi.source.CatalogueSource
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.online.HttpSource
import kotlinx.coroutines.flow.Flow
@@ -11,15 +10,15 @@ interface SourceManager {
val isInitialized: StateFlow<Boolean>
val catalogueSources: Flow<List<CatalogueSource>>
val sources: Flow<List<Source>>
fun get(sourceKey: Long): Source?
fun getOrStub(sourceKey: Long): Source
fun getOnlineSources(): List<HttpSource>
fun getAll(): List<Source>
fun getCatalogueSources(): List<CatalogueSource>
fun getOnlineSources(): List<HttpSource>
fun getStubSources(): List<StubSource>
}