From 7f7fe11e4e83f5745ed92446539ff108e6263768 Mon Sep 17 00:00:00 2001 From: Mike <51273546+SnakeDoc83@users.noreply.github.com> Date: Sun, 29 Mar 2020 07:41:37 -0400 Subject: [PATCH] MangaPark - fix thumbnails (#2537) --- src/en/mangapark/build.gradle | 2 +- .../extension/en/mangapark/MangaPark.kt | 20 +++++++------------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/en/mangapark/build.gradle b/src/en/mangapark/build.gradle index c36a3c818..e763e6f2b 100644 --- a/src/en/mangapark/build.gradle +++ b/src/en/mangapark/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: MangaPark' pkgNameSuffix = 'en.mangapark' extClass = '.MangaPark' - extVersionCode = 10 + extVersionCode = 11 libVersion = '1.2' } diff --git a/src/en/mangapark/src/eu/kanade/tachiyomi/extension/en/mangapark/MangaPark.kt b/src/en/mangapark/src/eu/kanade/tachiyomi/extension/en/mangapark/MangaPark.kt index f0321413c..99f12bfeb 100644 --- a/src/en/mangapark/src/eu/kanade/tachiyomi/extension/en/mangapark/MangaPark.kt +++ b/src/en/mangapark/src/eu/kanade/tachiyomi/extension/en/mangapark/MangaPark.kt @@ -43,11 +43,6 @@ class MangaPark : ConfigurableSource, ParsedHttpSource() { private val dateFormat = SimpleDateFormat("MMM d, yyyy, HH:mm a", Locale.ENGLISH) private val dateFormatTimeOnly = SimpleDateFormat("HH:mm a", Locale.ENGLISH) - private fun cleanUrl(url: String) = if (url.startsWith("//")) - "https:$url" - else url - - override fun popularMangaRequest(page: Int) = GET("$baseUrl$directoryUrl/$page?views_a") override fun popularMangaSelector() = directorySelector @@ -92,11 +87,10 @@ class MangaPark : ConfigurableSource, ParsedHttpSource() { @SuppressLint("DefaultLocale") override fun mangaDetailsParse(document: Document) = SManga.create().apply { - val coverElement = document.select(".cover > img").first() - - title = coverElement.attr("title") - - thumbnail_url = cleanUrl(coverElement.attr("src")) + document.select(".cover > img").first().let { coverElement -> + title = coverElement.attr("title") + thumbnail_url = coverElement.attr("abs:src") + } document.select(".attr > tbody > tr").forEach { when (it.getElementsByTag("th").first().text().trim().toLowerCase()) { @@ -121,7 +115,7 @@ class MangaPark : ConfigurableSource, ParsedHttpSource() { description = document.getElementsByClass("summary").text().trim() } - + override fun chapterListParse(response: Response): List { fun List.getMissingChapters(allChapters: List): List { val chapterNums = this.map { it.chapter_number } @@ -511,7 +505,7 @@ class MangaPark : ConfigurableSource, ParsedHttpSource() { screen.addPreference(myPref) } private fun getSourcePref(): String? = preferences.getString(SOURCE_PREF, "all") - + companion object { private const val SOURCE_PREF_TITLE = "Chapter List Source" private const val SOURCE_PREF = "Manga_Park_Source" @@ -526,5 +520,5 @@ class MangaPark : ConfigurableSource, ParsedHttpSource() { Pair("Prioritize source: Panda","panda") ) } - + }