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