Forcing webtoon mode on manhwa and long strip

This commit is contained in:
Jay 2020-04-17 23:23:57 -04:00
parent f0cb967f6a
commit 7ef5e59421
3 changed files with 8 additions and 9 deletions

View File

@ -103,16 +103,14 @@ interface Manga : SManga {
val currentTags = genre?.split(",")?.map { it.trim().toLowerCase(Locale.US) }
return if (currentTags?.any
{ tag ->
tag == "long strip" || tag == "manhwa" ||
tag.contains("webtoon")
} == true || isWebtoonSource(sourceName) ||
sourceName.contains("tapastic", true))
tag == "long strip" || tag == "manhwa" || tag.contains("webtoon")
} == true || isWebtoonSource(sourceName))
ReaderActivity.WEBTOON
else if (currentTags?.any
{ tag ->
tag == "chinese" || tag == "manhua" ||
tag.startsWith("english") || tag == "comic"
} == true || isComicSource(sourceName) ||
} == true || (isComicSource(sourceName) && !sourceName.contains("tapastic", true)) ||
sourceName.contains("manhua", true))
ReaderActivity.LEFT_TO_RIGHT
else 0
@ -126,7 +124,6 @@ interface Manga : SManga {
fun isComicSource(sourceName: String): Boolean {
return sourceName.contains("gunnerkrigg", true) ||
sourceName.contains("gunnerkrigg", true) ||
sourceName.contains("dilbert", true) ||
sourceName.contains("cyanide", true) ||
sourceName.contains("xkcd", true) ||

View File

@ -420,7 +420,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
).toLowerCase(Locale.getDefault())
), 8000
) {
setAction(R.string.use_default) {
if (mangaViewer != WEBTOON) setAction(R.string.use_default) {
presenter.setMangaViewer(0)
}
}

View File

@ -419,8 +419,10 @@ class ReaderPresenter(
*/
fun getMangaViewer(): Int {
val manga = manga ?: return preferences.defaultViewer()
if (manga.viewer == -1) {
manga.viewer = manga.defaultReaderType()
val readerType = manga.defaultReaderType()
if (manga.viewer == -1 ||
(readerType == ReaderActivity.WEBTOON && readerType != manga.viewer)) {
manga.viewer = readerType
db.updateMangaViewer(manga).asRxObservable().subscribe()
}
return if (manga.viewer == 0) preferences.defaultViewer() else manga.viewer