Cleanup
This commit is contained in:
parent
1ddfe956a7
commit
9af351e0dd
@ -464,11 +464,11 @@ class LibraryUpdateService(
|
||||
}
|
||||
|
||||
// SY -->
|
||||
val handler = CoroutineExceptionHandler { _, exception ->
|
||||
Timber.e(exception)
|
||||
}
|
||||
ioScope.launch(handler) {
|
||||
if (source.isMdBasedSource() && trackManager.mdList.isLogged) {
|
||||
if (source.isMdBasedSource() && trackManager.mdList.isLogged) {
|
||||
val handler = CoroutineExceptionHandler { _, exception ->
|
||||
Timber.e(exception)
|
||||
}
|
||||
ioScope.launch(handler) {
|
||||
val tracks = db.getTracks(manga).executeOnIO()
|
||||
if (tracks.isEmpty() || tracks.none { it.sync_id == TrackManager.MDLIST }) {
|
||||
var track = trackManager.mdList.createInitialTracker(manga)
|
||||
|
@ -14,7 +14,6 @@ import eu.kanade.tachiyomi.util.lang.runAsObservable
|
||||
import exh.metadata.metadata.base.RaisedSearchMetadata
|
||||
import exh.metadata.metadata.base.getFlatMetadataForManga
|
||||
import exh.metadata.metadata.base.insertFlatMetadata
|
||||
import exh.util.executeOnIO
|
||||
import rx.Completable
|
||||
import rx.Single
|
||||
import tachiyomi.source.model.MangaInfo
|
||||
|
@ -437,13 +437,13 @@ open class BrowseSourceController(bundle: Bundle) :
|
||||
super.onPrepareOptionsMenu(menu)
|
||||
|
||||
val isHttpSource = presenter.source is HttpSource
|
||||
menu.findItem(R.id.action_open_in_web_view).isVisible = isHttpSource
|
||||
menu.findItem(R.id.action_open_in_web_view)?.isVisible = isHttpSource
|
||||
|
||||
val isLocalSource = presenter.source is LocalSource
|
||||
menu.findItem(R.id.action_local_source_help).isVisible = isLocalSource
|
||||
menu.findItem(R.id.action_local_source_help)?.isVisible = isLocalSource
|
||||
|
||||
// SY -->
|
||||
menu.findItem(R.id.action_settings).isVisible = presenter.source is ConfigurableSource
|
||||
menu.findItem(R.id.action_settings)?.isVisible = presenter.source is ConfigurableSource
|
||||
// SY <--
|
||||
}
|
||||
|
||||
|
@ -179,11 +179,17 @@ open class BrowseSourcePresenter(
|
||||
pagerSubscription = pager.results()
|
||||
.observeOn(Schedulers.io())
|
||||
// SY -->
|
||||
.map { triple -> Triple(triple.first, triple.second.map { networkToLocalManga(it, sourceId) }, triple.third) }
|
||||
.map { (page, mangas, metadata) ->
|
||||
Triple(page, mangas.map { networkToLocalManga(it, sourceId) }, metadata)
|
||||
}
|
||||
// SY <--
|
||||
.doOnNext { initializeMangas(it.second) }
|
||||
// SY -->
|
||||
.map { triple -> triple.first to triple.second.mapIndexed { index, manga -> SourceItem(manga, sourceDisplayMode, triple.third?.getOrNull(index)) } }
|
||||
.map { (page, mangas, metadata) ->
|
||||
page to mangas.mapIndexed { index, manga ->
|
||||
SourceItem(manga, sourceDisplayMode, metadata?.getOrNull(index))
|
||||
}
|
||||
}
|
||||
// SY <--
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeReplay(
|
||||
|
@ -81,7 +81,11 @@ class SourceEnhancedEHentaiListHolder(private val view: View, adapter: FlexibleA
|
||||
|
||||
metadata.averageRating?.let { binding.ratingBar.rating = it.toFloat() }
|
||||
|
||||
val locale = SourceTagsUtil.getLocaleSourceUtil(metadata.tags.firstOrNull { it.namespace == "language" }?.name)
|
||||
val locale = SourceTagsUtil.getLocaleSourceUtil(
|
||||
metadata.tags
|
||||
.firstOrNull { it.namespace == EHentaiSearchMetadata.EH_LANGUAGE_NAMESPACE }
|
||||
?.name
|
||||
)
|
||||
val pageCount = metadata.length
|
||||
|
||||
binding.language.text = if (locale != null && pageCount != null) {
|
||||
|
@ -17,7 +17,6 @@ import exh.metadata.metadata.base.getFlatMetadataForManga
|
||||
import exh.metadata.metadata.base.insertFlatMetadata
|
||||
import exh.util.capitalize
|
||||
import exh.util.dropEmpty
|
||||
import exh.util.executeOnIO
|
||||
import exh.util.floor
|
||||
import exh.util.nullIfEmpty
|
||||
import okhttp3.OkHttpClient
|
||||
|
@ -125,6 +125,7 @@ class EHentaiSearchMetadata : RaisedSearchMetadata() {
|
||||
|
||||
const val EH_GENRE_NAMESPACE = "genre"
|
||||
private const val EH_ARTIST_NAMESPACE = "artist"
|
||||
const val EH_LANGUAGE_NAMESPACE = "language"
|
||||
|
||||
private fun splitGalleryUrl(url: String) =
|
||||
url.let {
|
||||
|
Loading…
x
Reference in New Issue
Block a user