From 482e03f44939c53b0381c9908fbdf60bb0abfdae Mon Sep 17 00:00:00 2001 From: Mike <51273546+SnakeDoc83@users.noreply.github.com> Date: Tue, 10 Dec 2019 08:09:20 -0500 Subject: [PATCH] Move ZeroScans (#1867) Move ZeroScans --- src/all/genkan/build.gradle | 2 +- .../tachiyomi/extension/all/genkan/Genkan.kt | 38 +++++++++---------- .../extension/all/genkan/GenkanFactory.kt | 4 +- src/all/madara/build.gradle | 2 +- .../extension/all/madara/MadaraFactory.kt | 3 -- 5 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/all/genkan/build.gradle b/src/all/genkan/build.gradle index 15ce14803..d9dfdda8b 100644 --- a/src/all/genkan/build.gradle +++ b/src/all/genkan/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: Genkan (multiple sources)' pkgNameSuffix = 'all.genkan' extClass = '.GenkanFactory' - extVersionCode = 8 + extVersionCode = 9 libVersion = '1.2' } diff --git a/src/all/genkan/src/eu/kanade/tachiyomi/extension/all/genkan/Genkan.kt b/src/all/genkan/src/eu/kanade/tachiyomi/extension/all/genkan/Genkan.kt index a65b27047..7c71391fc 100644 --- a/src/all/genkan/src/eu/kanade/tachiyomi/extension/all/genkan/Genkan.kt +++ b/src/all/genkan/src/eu/kanade/tachiyomi/extension/all/genkan/Genkan.kt @@ -97,31 +97,29 @@ abstract class Genkan( } override fun mangaDetailsParse(document: Document): SManga { - val infoElement = document.select("div#content").first() - - val manga = SManga.create() - manga.title = infoElement.select("h5").first().text() - - manga.description = document.select("div.col-lg-9").text().substringAfter("Description ").substringBefore(" Volume") - manga.thumbnail_url = styleToUrl(document.select("div.media a").first()) - return manga + return SManga.create().apply { + title = document.select("div#content h5").first().text() + description = document.select("div.col-lg-9").text().substringAfter("Description ").substringBefore(" Volume") + thumbnail_url = styleToUrl(document.select("div.media a").first()) + } } override fun chapterListSelector() = "div.col-lg-9 div.flex" override fun chapterFromElement(element: Element): SChapter { - val urlElement = element.select("a.item-author") + return SChapter.create().apply { - val chapNum = urlElement.attr("href").split("/").last() - val chapter = SChapter.create() - chapter.setUrlWithoutDomain(urlElement.attr("href")) - if (urlElement.text().contains("Chapter $chapNum")) { - chapter.name = urlElement.text() - } else { - chapter.name = "Ch. " + chapNum + ": " + urlElement.text() + val urlElement = element.select("a.item-author") + val chapNum = urlElement.attr("href").split("/").last() + + setUrlWithoutDomain(urlElement.attr("href")) + name = if (urlElement.text().contains("Chapter $chapNum")) { + urlElement.text() + } else { + "Ch. $chapNum: ${urlElement.text()}" + } + date_upload = parseChapterDate(element.select("a.item-company").first().text()) ?: 0 } - chapter.date_upload = parseChapterDate(element.select("a.item-company").first().text()) ?: 0 - return chapter } companion object { @@ -194,7 +192,7 @@ abstract class GenkanOriginal( override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { if (page == 1) searchPage = 1 - searchQuery = query.toLowerCase() + searchQuery = query return popularMangaRequest(page) } @@ -219,7 +217,7 @@ abstract class GenkanOriginal( private fun getMatchesFrom(document: Document): MutableList { val searchMatches = mutableListOf() document.select(searchMangaSelector()) - .filter { it.text().toLowerCase().contains(searchQuery) } + .filter { it.text().contains(searchQuery, ignoreCase = true) } .map { searchMatches.add(searchMangaFromElement(it)) } return searchMatches diff --git a/src/all/genkan/src/eu/kanade/tachiyomi/extension/all/genkan/GenkanFactory.kt b/src/all/genkan/src/eu/kanade/tachiyomi/extension/all/genkan/GenkanFactory.kt index effde6d4b..d9c3ae373 100644 --- a/src/all/genkan/src/eu/kanade/tachiyomi/extension/all/genkan/GenkanFactory.kt +++ b/src/all/genkan/src/eu/kanade/tachiyomi/extension/all/genkan/GenkanFactory.kt @@ -12,7 +12,8 @@ class GenkanFactory : SourceFactory { KaguyaDex(), KomiScans(), HunlightScans(), - WoweScans() + WoweScans(), + ZeroScans() ) } @@ -27,3 +28,4 @@ class KaguyaDex : GenkanOriginal("KaguyaDex", " https://kaguyadex.com", "en") class KomiScans : GenkanOriginal("Komi Scans", " https://komiscans.com", "en") class HunlightScans : Genkan("Hunlight Scans", "https://hunlight-scans.info", "en") class WoweScans : Genkan("Wowe Scans", "https://wowescans.co", "en") +class ZeroScans : Genkan("ZeroScans", "https://zeroscans.com", "en") diff --git a/src/all/madara/build.gradle b/src/all/madara/build.gradle index e9023ec8a..1cc8acbc3 100644 --- a/src/all/madara/build.gradle +++ b/src/all/madara/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: Madara (multiple sources)' pkgNameSuffix = "all.madara" extClass = '.MadaraFactory' - extVersionCode = 34 + extVersionCode = 35 libVersion = '1.2' } diff --git a/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/MadaraFactory.kt b/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/MadaraFactory.kt index a8f69c69d..bea66a395 100644 --- a/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/MadaraFactory.kt +++ b/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/MadaraFactory.kt @@ -23,7 +23,6 @@ class MadaraFactory : SourceFactory { Mangasushi(), NinjaScans(), ReadManhua(), - ZeroScans(), IsekaiScanCom(), HappyTeaScans(), JustForFun(), @@ -72,8 +71,6 @@ class NinjaScans : Madara("NinjaScans", "https://ninjascans.com", "en") class ReadManhua : Madara("ReadManhua", "https://readmanhua.net", "en", dateFormat = SimpleDateFormat("dd MMM yy", Locale.US)) -class ZeroScans : Madara("ZeroScans", "https://zeroscans.com", "en") - class IsekaiScanCom : Madara("IsekaiScan.com", "https://isekaiscan.com/", "en") class HappyTeaScans : Madara("Happy Tea Scans", "https://happyteascans.com/", "en")