mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-12 12:08:56 +01:00
Rename OnlineSource to HttpSource
This commit is contained in:
@@ -16,7 +16,7 @@ import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||
import eu.kanade.tachiyomi.source.Source
|
||||
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.base.fragment.BaseRxFragment
|
||||
import eu.kanade.tachiyomi.ui.manga.MangaActivity
|
||||
import eu.kanade.tachiyomi.util.getResourceColor
|
||||
@@ -164,7 +164,7 @@ class MangaInfoFragment : BaseRxFragment<MangaInfoPresenter>() {
|
||||
* Open the manga in browser.
|
||||
*/
|
||||
fun openInBrowser() {
|
||||
val source = presenter.source as? OnlineSource ?: return
|
||||
val source = presenter.source as? HttpSource ?: return
|
||||
try {
|
||||
val url = Uri.parse(source.baseUrl + presenter.manga.url)
|
||||
val intent = CustomTabsIntent.Builder()
|
||||
@@ -180,7 +180,7 @@ class MangaInfoFragment : BaseRxFragment<MangaInfoPresenter>() {
|
||||
* Called to run Intent with [Intent.ACTION_SEND], which show share dialog.
|
||||
*/
|
||||
private fun shareManga() {
|
||||
val source = presenter.source as? OnlineSource ?: return
|
||||
val source = presenter.source as? HttpSource ?: return
|
||||
try {
|
||||
val url = source.mangaDetailsRequest(presenter.manga).url().toString()
|
||||
val sharingIntent = Intent(Intent.ACTION_SEND).apply {
|
||||
|
||||
@@ -4,7 +4,7 @@ import eu.kanade.tachiyomi.data.database.models.Manga
|
||||
import eu.kanade.tachiyomi.data.download.DownloadManager
|
||||
import eu.kanade.tachiyomi.source.Source
|
||||
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.fetchImageFromCacheThenNet
|
||||
import eu.kanade.tachiyomi.source.online.fetchPageListFromCacheThenNet
|
||||
import eu.kanade.tachiyomi.util.plusAssign
|
||||
@@ -39,7 +39,7 @@ class ChapterLoader(
|
||||
}
|
||||
|
||||
private fun prepareOnlineReading() {
|
||||
if (source !is OnlineSource) return
|
||||
if (source !is HttpSource) return
|
||||
|
||||
subscriptions += Observable.defer { Observable.just(queue.take().page) }
|
||||
.filter { it.status == Page.QUEUE }
|
||||
@@ -85,7 +85,7 @@ class ChapterLoader(
|
||||
// Fetch the page list from disk.
|
||||
downloadManager.buildPageList(source, manga, chapter)
|
||||
} else {
|
||||
(source as? OnlineSource)?.fetchPageListFromCacheThenNet(chapter)
|
||||
(source as? HttpSource)?.fetchPageListFromCacheThenNet(chapter)
|
||||
?: source.fetchPageList(chapter)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import eu.kanade.tachiyomi.data.download.DownloadManager
|
||||
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.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.data.track.TrackUpdateService
|
||||
import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter
|
||||
@@ -348,7 +348,7 @@ class ReaderPresenter : BasePresenter<ReaderActivity>() {
|
||||
* @param page the page that failed.
|
||||
*/
|
||||
fun retryPage(page: Page?) {
|
||||
if (page != null && source is OnlineSource) {
|
||||
if (page != null && source is HttpSource) {
|
||||
page.status = Page.QUEUE
|
||||
val uri = page.uri
|
||||
if (uri != null && !page.chapter.isDownloaded) {
|
||||
@@ -372,7 +372,7 @@ class ReaderPresenter : BasePresenter<ReaderActivity>() {
|
||||
// Cache current page list progress for online chapters to allow a faster reopen
|
||||
if (!chapter.isDownloaded) {
|
||||
source.let {
|
||||
if (it is OnlineSource) chapterCache.putPageListToCache(chapter, pages)
|
||||
if (it is HttpSource) chapterCache.putPageListToCache(chapter, pages)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import android.view.View
|
||||
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.online.OnlineSource
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import eu.kanade.tachiyomi.widget.preference.LoginCheckBoxPreference
|
||||
import eu.kanade.tachiyomi.widget.preference.SourceLoginDialog
|
||||
import eu.kanade.tachiyomi.widget.preference.SwitchPreferenceCategory
|
||||
@@ -87,7 +87,7 @@ class SettingsSourcesFragment : SettingsFragment() {
|
||||
*
|
||||
* @param group the language category.
|
||||
*/
|
||||
private fun addLanguageSources(group: SwitchPreferenceCategory, sources: List<OnlineSource>) {
|
||||
private fun addLanguageSources(group: SwitchPreferenceCategory, sources: List<HttpSource>) {
|
||||
val hiddenCatalogues = preferences.hiddenCatalogues().getOrDefault()
|
||||
|
||||
sources.forEach { source ->
|
||||
|
||||
Reference in New Issue
Block a user