mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 08:08:55 +01:00 
			
		
		
		
	Add newer methods to StubSource
This commit is contained in:
		@@ -11,6 +11,8 @@ import kotlinx.coroutines.flow.MutableStateFlow
 | 
			
		||||
import kotlinx.coroutines.flow.map
 | 
			
		||||
import kotlinx.coroutines.flow.update
 | 
			
		||||
import rx.Observable
 | 
			
		||||
import tachiyomi.source.model.ChapterInfo
 | 
			
		||||
import tachiyomi.source.model.MangaInfo
 | 
			
		||||
 | 
			
		||||
open class SourceManager(private val context: Context) {
 | 
			
		||||
 | 
			
		||||
@@ -65,19 +67,32 @@ open class SourceManager(private val context: Context) {
 | 
			
		||||
        LocalSource(context),
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    @Suppress("OverridingDeprecatedMember")
 | 
			
		||||
    inner class StubSource(override val id: Long) : Source {
 | 
			
		||||
 | 
			
		||||
        override val name: String
 | 
			
		||||
            get() = id.toString()
 | 
			
		||||
 | 
			
		||||
        override suspend fun getMangaDetails(manga: MangaInfo): MangaInfo {
 | 
			
		||||
            throw getSourceNotInstalledException()
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        override fun fetchMangaDetails(manga: SManga): Observable<SManga> {
 | 
			
		||||
            return Observable.error(getSourceNotInstalledException())
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        override suspend fun getChapterList(manga: MangaInfo): List<ChapterInfo> {
 | 
			
		||||
            throw getSourceNotInstalledException()
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
 | 
			
		||||
            return Observable.error(getSourceNotInstalledException())
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        override suspend fun getPageList(chapter: ChapterInfo): List<tachiyomi.source.model.Page> {
 | 
			
		||||
            throw getSourceNotInstalledException()
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        override fun fetchPageList(chapter: SChapter): Observable<List<Page>> {
 | 
			
		||||
            return Observable.error(getSourceNotInstalledException())
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user