From 9d8c5fbabda5eb1a041195e7a757a987aca6e44c Mon Sep 17 00:00:00 2001 From: Logan B Date: Sat, 2 Feb 2019 02:25:06 +1300 Subject: [PATCH] QuestionableContent: Fix jpg, gif images not showing; fix duplicate pages making Tachi go in loops (#757) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QuestionableContent: Fix jpg, gif images not showing; fix duplicate p… --- src/en/questionablecontent/build.gradle | 2 +- .../QuestionableContent.kt | 23 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/en/questionablecontent/build.gradle b/src/en/questionablecontent/build.gradle index f90abdcb3..ac303073e 100644 --- a/src/en/questionablecontent/build.gradle +++ b/src/en/questionablecontent/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: Questionable Content' pkgNameSuffix = 'en.questionablecontent' extClass = '.QuestionableContent' - extVersionCode = 2 + extVersionCode = 3 libVersion = '1.2' } diff --git a/src/en/questionablecontent/src/eu/kanade/tachiyomi/extension/en/questionablecontent/QuestionableContent.kt b/src/en/questionablecontent/src/eu/kanade/tachiyomi/extension/en/questionablecontent/QuestionableContent.kt index 6b0c89a59..539b7cb5e 100644 --- a/src/en/questionablecontent/src/eu/kanade/tachiyomi/extension/en/questionablecontent/QuestionableContent.kt +++ b/src/en/questionablecontent/src/eu/kanade/tachiyomi/extension/en/questionablecontent/QuestionableContent.kt @@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.extension.en.questionablecontent import eu.kanade.tachiyomi.source.model.* import eu.kanade.tachiyomi.source.online.ParsedHttpSource import okhttp3.Request +import okhttp3.Response import org.jsoup.nodes.Document import org.jsoup.nodes.Element import rx.Observable @@ -35,6 +36,10 @@ class QuestionableContent : ParsedHttpSource() { override fun fetchMangaDetails(manga: SManga) = Observable.just(manga) + override fun chapterListParse(response: Response): List { + return super.chapterListParse(response).distinct() + } + override fun chapterListSelector() = """div#container a[href^="view.php?comic="]""" override fun chapterFromElement(element: Element): SChapter { @@ -42,20 +47,14 @@ class QuestionableContent : ParsedHttpSource() { val chapterUrl = element.attr("href") val number = urlregex.find(chapterUrl)!!.groupValues[1] - return SChapter.create().apply { - url = chapterUrl - chapter_number = number.toFloat() - name = element.text() - } + val chapter = SChapter.create() + chapter.setUrlWithoutDomain("/$chapterUrl") + chapter.name = element.text() + chapter.chapter_number = number.toFloat() + return chapter } - override fun fetchPageList(chapter: SChapter): Observable> { - val pages = mutableListOf() - pages.add(Page(0, "", "$baseUrl/comics/${chapter.chapter_number.toInt()}.png")) - return Observable.just(pages) - } - - override fun pageListParse(document: Document): List = throw Exception("Not used") + override fun pageListParse(document: Document) = document.select("#strip").mapIndexed { i, element -> Page(i, "", baseUrl + element.attr("src").substring(1)) } override fun imageUrlParse(document: Document) = throw Exception("Not used")