MyReadingManga - fix titles, duplicate pages (#4119)

This commit is contained in:
Mike 2020-08-13 23:00:32 -04:00 committed by GitHub
parent 7a8dfac7a8
commit 767a1ee1fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -5,8 +5,9 @@ ext {
extName = 'MyReadingManga'
pkgNameSuffix = 'all.myreadingmanga'
extClass = '.MyReadingMangaFactory'
extVersionCode = 38
extVersionCode = 39
libVersion = '1.2'
containsNsfw = true
}
apply from: "$rootDir/common.gradle"

View File

@ -121,7 +121,8 @@ open class MyReadingManga(override val lang: String, private val siteLang: Strin
}
// cleans up the name removing author and language from the title
private fun cleanTitle(title: String) = title.substringBeforeLast("[").substringAfterLast("]").substringBeforeLast("(").trim()
private val titleRegex = Regex("""\[[^]]*]""")
private fun cleanTitle(title: String) = title.replace(titleRegex, "").substringBeforeLast("(").trim()
private fun cleanAuthor(author: String) = author.substringAfter("[").substringBefore("]").trim()
@ -209,7 +210,9 @@ open class MyReadingManga(override val lang: String, private val siteLang: Strin
override fun pageListParse(document: Document): List<Page> {
return (document.select("div > img") + document.select("div.separator img[data-src]"))
.mapIndexed { i, img -> Page(i, "", getImage(img)) }
.map { getImage(it) }
.distinct()
.mapIndexed { i, url -> Page(i, "", url) }
}
override fun imageUrlParse(document: Document) = throw Exception("Not used")

View File

@ -1,8 +1,10 @@
package eu.kanade.tachiyomi.extension.all.myreadingmanga
import eu.kanade.tachiyomi.annotations.Nsfw
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
@Nsfw
class MyReadingMangaFactory : SourceFactory {
override fun createSources(): List<Source> = languageList.map { MyReadingManga(it.tachiLang, it.siteLang, it.latestLang) }
}