mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 22:37:56 +01:00 
			
		
		
		
	Rename OnlineSource to HttpSource
This commit is contained in:
		| @@ -6,7 +6,7 @@ import eu.kanade.tachiyomi.data.database.DatabaseHelper | ||||
| import eu.kanade.tachiyomi.data.database.models.Manga | ||||
| import eu.kanade.tachiyomi.data.download.model.Download | ||||
| import eu.kanade.tachiyomi.source.SourceManager | ||||
| import eu.kanade.tachiyomi.source.online.OnlineSource | ||||
| import eu.kanade.tachiyomi.source.online.HttpSource | ||||
| import uy.kohesive.injekt.injectLazy | ||||
|  | ||||
| /** | ||||
| @@ -93,7 +93,7 @@ class DownloadStore(context: Context) { | ||||
|                 val manga = cachedManga.getOrPut(mangaId) { | ||||
|                     db.getManga(mangaId).executeAsBlocking() | ||||
|                 } ?: continue | ||||
|                 val source = sourceManager.get(manga.source) as? OnlineSource ?: continue | ||||
|                 val source = sourceManager.get(manga.source) as? HttpSource ?: continue | ||||
|                 val chapter = db.getChapter(chapterId).executeAsBlocking() ?: continue | ||||
|                 downloads.add(Download(source, manga, chapter)) | ||||
|             } | ||||
|   | ||||
| @@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.data.download.model.DownloadQueue | ||||
| import eu.kanade.tachiyomi.data.preference.PreferencesHelper | ||||
| import eu.kanade.tachiyomi.source.SourceManager | ||||
| import eu.kanade.tachiyomi.source.model.Page | ||||
| import eu.kanade.tachiyomi.source.online.OnlineSource | ||||
| import eu.kanade.tachiyomi.source.online.HttpSource | ||||
| import eu.kanade.tachiyomi.source.online.fetchAllImageUrlsFromPageList | ||||
| import eu.kanade.tachiyomi.util.DynamicConcurrentMergeOperator | ||||
| import eu.kanade.tachiyomi.util.RetryWithDelay | ||||
| @@ -220,7 +220,7 @@ class Downloader(private val context: Context, private val provider: DownloadPro | ||||
|      * @param chapters the list of chapters to download. | ||||
|      */ | ||||
|     fun queueChapters(manga: Manga, chapters: List<Chapter>) { | ||||
|         val source = sourceManager.get(manga.source) as? OnlineSource ?: return | ||||
|         val source = sourceManager.get(manga.source) as? HttpSource ?: return | ||||
|  | ||||
|         val chaptersToQueue = chapters | ||||
|                 // Avoid downloading chapters with the same name. | ||||
| @@ -373,7 +373,7 @@ class Downloader(private val context: Context, private val provider: DownloadPro | ||||
|      * @param tmpDir the temporary directory of the download. | ||||
|      * @param filename the filename of the image. | ||||
|      */ | ||||
|     private fun downloadImage(page: Page, source: OnlineSource, tmpDir: UniFile, filename: String): Observable<UniFile> { | ||||
|     private fun downloadImage(page: Page, source: HttpSource, tmpDir: UniFile, filename: String): Observable<UniFile> { | ||||
|         page.status = Page.DOWNLOAD_IMAGE | ||||
|         page.progress = 0 | ||||
|         return source.fetchImage(page) | ||||
|   | ||||
| @@ -3,10 +3,10 @@ package eu.kanade.tachiyomi.data.download.model | ||||
| import eu.kanade.tachiyomi.data.database.models.Chapter | ||||
| import eu.kanade.tachiyomi.data.database.models.Manga | ||||
| import eu.kanade.tachiyomi.source.model.Page | ||||
| import eu.kanade.tachiyomi.source.online.OnlineSource | ||||
| import eu.kanade.tachiyomi.source.online.HttpSource | ||||
| import rx.subjects.PublishSubject | ||||
|  | ||||
| class Download(val source: OnlineSource, val manga: Manga, val chapter: Chapter) { | ||||
| class Download(val source: HttpSource, val manga: Manga, val chapter: Chapter) { | ||||
|  | ||||
|     var pages: List<Page>? = null | ||||
|  | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import com.bumptech.glide.load.model.stream.StreamModelLoader | ||||
| import eu.kanade.tachiyomi.data.cache.CoverCache | ||||
| import eu.kanade.tachiyomi.data.database.models.Manga | ||||
| import eu.kanade.tachiyomi.source.SourceManager | ||||
| import eu.kanade.tachiyomi.source.online.OnlineSource | ||||
| import eu.kanade.tachiyomi.source.online.HttpSource | ||||
| import uy.kohesive.injekt.injectLazy | ||||
| import java.io.File | ||||
| import java.io.InputStream | ||||
| @@ -102,7 +102,7 @@ class MangaModelLoader(context: Context) : StreamModelLoader<Manga> { | ||||
|      * @param manga the model. | ||||
|      */ | ||||
|     fun getHeaders(manga: Manga): Headers { | ||||
|         val source = sourceManager.get(manga.source) as? OnlineSource ?: return LazyHeaders.DEFAULT | ||||
|         val source = sourceManager.get(manga.source) as? HttpSource ?: return LazyHeaders.DEFAULT | ||||
|         return cachedHeaders.getOrPut(manga.source) { | ||||
|             LazyHeaders.Builder().apply { | ||||
|                 val nullStr: String? = null | ||||
|   | ||||
| @@ -22,7 +22,7 @@ import eu.kanade.tachiyomi.data.preference.PreferencesHelper | ||||
| import eu.kanade.tachiyomi.data.preference.getOrDefault | ||||
| import eu.kanade.tachiyomi.source.SourceManager | ||||
| import eu.kanade.tachiyomi.source.model.SManga | ||||
| import eu.kanade.tachiyomi.source.online.OnlineSource | ||||
| import eu.kanade.tachiyomi.source.online.HttpSource | ||||
| import eu.kanade.tachiyomi.ui.main.MainActivity | ||||
| import eu.kanade.tachiyomi.util.* | ||||
| import rx.Observable | ||||
| @@ -300,7 +300,7 @@ class LibraryUpdateService : Service() { | ||||
|      * @return a pair of the inserted and removed chapters. | ||||
|      */ | ||||
|     fun updateManga(manga: Manga): Observable<Pair<List<Chapter>, List<Chapter>>> { | ||||
|         val source = sourceManager.get(manga.source) as? OnlineSource ?: return Observable.empty() | ||||
|         val source = sourceManager.get(manga.source) as? HttpSource ?: return Observable.empty() | ||||
|         return source.fetchChapterList(manga) | ||||
|                 .map { syncChaptersWithSource(db, it, manga, source) } | ||||
|     } | ||||
| @@ -324,7 +324,7 @@ class LibraryUpdateService : Service() { | ||||
|                 .doOnNext { showProgressNotification(it, count.andIncrement, mangaToUpdate.size, cancelPendingIntent) } | ||||
|                 // Update the details of the manga. | ||||
|                 .concatMap { manga -> | ||||
|                     val source = sourceManager.get(manga.source) as? OnlineSource | ||||
|                     val source = sourceManager.get(manga.source) as? HttpSource | ||||
|                             ?: return@concatMap Observable.empty<Manga>() | ||||
|  | ||||
|                     source.fetchMangaDetails(manga) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user