From d2f674418877e7e4a8322e2e776021f4ddf47759 Mon Sep 17 00:00:00 2001 From: Eugene Date: Sun, 5 Aug 2018 16:48:02 -0400 Subject: [PATCH] Update common dependencies (#441) Update common dependencies --- common.gradle | 8 ++++---- .../kanade/tachiyomi/extension/all/mangadex/Mangadex.kt | 6 ++---- .../extension/all/myreadingmanga/MyReadingManga.kt | 2 +- .../eu/kanade/tachiyomi/extension/all/nhentai/NHentai.kt | 8 ++++---- .../kanade/tachiyomi/extension/en/dynasty/DynastyScans.kt | 6 +++--- .../tachiyomi/extension/en/hentai2read/Hentai2Read.kt | 4 ++-- .../eu/kanade/tachiyomi/extension/en/mangacow/Mangacow.kt | 4 ++-- .../kanade/tachiyomi/extension/en/mangaeden/Mangaeden.kt | 4 ++-- .../kanade/tachiyomi/extension/en/mangazuki/Mangazuki.kt | 5 ++--- .../eu/kanade/tachiyomi/extension/en/perveden/Perveden.kt | 4 ++-- .../extension/en/readcomiconline/Readcomiconline.kt | 2 +- .../tachiyomi/extension/en/shoujosense/ShoujoSense.kt | 4 ++-- .../eu/kanade/tachiyomi/extension/en/webtoons/Webtoons.kt | 5 ++--- .../tachiyomi/extension/it/hentaifantasy/HentaiFantasy.kt | 4 ++-- .../kanade/tachiyomi/extension/it/mangaeden/Mangaeden.kt | 4 ++-- .../eu/kanade/tachiyomi/extension/it/perveden/Perveden.kt | 4 ++-- .../tachiyomi/extension/pt/unionmangas/UnionMangas.kt | 2 +- .../tachiyomi/extension/vi/truyentranhlh/Truyentranhlh.kt | 6 +++--- 18 files changed, 39 insertions(+), 43 deletions(-) diff --git a/common.gradle b/common.gradle index e9b4cfbd4..6dd5203a6 100644 --- a/common.gradle +++ b/common.gradle @@ -45,9 +45,9 @@ repositories { } dependencies { - compileOnly "eu.kanade.tachiyomi:extensions-library:$libVersion" - compileOnly 'com.squareup.okhttp3:okhttp:3.5.0' - compileOnly 'io.reactivex:rxjava:1.2.4' - compileOnly 'org.jsoup:jsoup:1.10.1' compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + compileOnly "eu.kanade.tachiyomi:extensions-library:$libVersion" + compileOnly 'com.squareup.okhttp3:okhttp:3.10.0' + compileOnly 'io.reactivex:rxjava:1.3.6' + compileOnly 'org.jsoup:jsoup:1.10.2' } diff --git a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/Mangadex.kt b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/Mangadex.kt index f56a0051e..d618a5fdf 100644 --- a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/Mangadex.kt +++ b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/Mangadex.kt @@ -276,7 +276,7 @@ open class Mangadex(override val lang: String, private val internalLang: String, private fun isMangaCompleted(finalChapterNumber: String, chapterJson: JsonObject): Boolean { val count = chapterJson.entrySet() .filter { it -> it.value.asJsonObject.get("lang_code").string == internalLang } - .filter { it -> doesFinalChapterExist(finalChapterNumber, it.value) }?.count() + .filter { it -> doesFinalChapterExist(finalChapterNumber, it.value) }.count() return when (count) { 0 -> false else -> true @@ -352,8 +352,6 @@ open class Mangadex(override val lang: String, private val internalLang: String, override fun pageListParse(document: Document): List { val pages = mutableListOf() - val url = document.baseUri() - val dataUrl = document.select("script").last().html().substringAfter("dataurl = '").substringBefore("';") val imageUrl = document.select("script").last().html().substringAfter("page_array = [").substringBefore("];") val listImageUrls = imageUrl.replace("'", "").split(",") @@ -474,4 +472,4 @@ open class Mangadex(override val lang: String, private val internalLang: String, private const val BASE_CHAPTER = "/chapter/" } -} \ No newline at end of file +} diff --git a/src/all/myreadingmanga/src/eu/kanade/tachiyomi/extension/all/myreadingmanga/MyReadingManga.kt b/src/all/myreadingmanga/src/eu/kanade/tachiyomi/extension/all/myreadingmanga/MyReadingManga.kt index ca51c6cac..e764f6320 100644 --- a/src/all/myreadingmanga/src/eu/kanade/tachiyomi/extension/all/myreadingmanga/MyReadingManga.kt +++ b/src/all/myreadingmanga/src/eu/kanade/tachiyomi/extension/all/myreadingmanga/MyReadingManga.kt @@ -40,7 +40,7 @@ open class MyReadingManga(override val lang: String) : ParsedHttpSource() { } } - val hasNextPage = popularMangaNextPageSelector()?.let { selector -> + val hasNextPage = popularMangaNextPageSelector().let { selector -> document.select(selector).first() } != null diff --git a/src/all/nhentai/src/eu/kanade/tachiyomi/extension/all/nhentai/NHentai.kt b/src/all/nhentai/src/eu/kanade/tachiyomi/extension/all/nhentai/NHentai.kt index aa53cb152..c1a5604af 100644 --- a/src/all/nhentai/src/eu/kanade/tachiyomi/extension/all/nhentai/NHentai.kt +++ b/src/all/nhentai/src/eu/kanade/tachiyomi/extension/all/nhentai/NHentai.kt @@ -55,7 +55,7 @@ open class NHentai(override val lang: String, val nhLang: String) : HttpSource() = throw UnsupportedOperationException("This method should not be called!") override fun mangaDetailsParse(response: Response) - = parseGallery(jsonParser.parse(response.body().string()).obj) + = parseGallery(jsonParser.parse(response.body()!!.string()).obj) //Hack so we can use a different URL for fetching manga details and opening the details in the browser override fun fetchMangaDetails(manga: SManga) @@ -70,7 +70,7 @@ open class NHentai(override val lang: String, val nhLang: String) : HttpSource() fun urlToDetailsRequest(url: String) = nhGet("$baseUrl/api/gallery/${url.substringAfterLast('/')}") fun parseResultPage(response: Response): MangasPage { - val res = jsonParser.parse(response.body().string()).obj + val res = jsonParser.parse(response.body()!!.string()).obj res["error"]?.let { throw RuntimeException("An error occurred while performing the search: $it") @@ -120,7 +120,7 @@ open class NHentai(override val lang: String, val nhLang: String) : HttpSource() tags.clear() }?.forEach { if (it.first != null && it.second != null) - tags.getOrPut(it.first!!, { mutableListOf() }).add(Tag(it.second!!, false)) + tags.getOrPut(it.first!!) { mutableListOf() }.add(Tag(it.second!!, false)) }!! } @@ -132,7 +132,7 @@ open class NHentai(override val lang: String, val nhLang: String) : HttpSource() client.newCall(urlToDetailsRequest(url)) .asObservableSuccess() .map { - rawParseGallery(jsonParser.parse(it.body().string()).obj) + rawParseGallery(jsonParser.parse(it.body()!!.string()).obj) }!! override fun fetchChapterList(manga: SManga) diff --git a/src/en/dynasty/src/eu/kanade/tachiyomi/extension/en/dynasty/DynastyScans.kt b/src/en/dynasty/src/eu/kanade/tachiyomi/extension/en/dynasty/DynastyScans.kt index 497fd335d..9e8bf6a98 100644 --- a/src/en/dynasty/src/eu/kanade/tachiyomi/extension/en/dynasty/DynastyScans.kt +++ b/src/en/dynasty/src/eu/kanade/tachiyomi/extension/en/dynasty/DynastyScans.kt @@ -106,8 +106,8 @@ abstract class DynastyScans : ParsedHttpSource() { protected fun parseGenres(elements: Elements, manga: SManga) { if (!elements.isEmpty()) { - var genres = mutableListOf() - elements?.forEach { + val genres = mutableListOf() + elements.forEach { genres.add(it.text()) } manga.genre = genres.joinToString(", ") @@ -233,4 +233,4 @@ abstract class DynastyScans : ParsedHttpSource() { return popularMangaRequest(page) } -} \ No newline at end of file +} diff --git a/src/en/hentai2read/src/eu/kanade/tachiyomi/extension/en/hentai2read/Hentai2Read.kt b/src/en/hentai2read/src/eu/kanade/tachiyomi/extension/en/hentai2read/Hentai2Read.kt index da0934877..8a3cfa998 100644 --- a/src/en/hentai2read/src/eu/kanade/tachiyomi/extension/en/hentai2read/Hentai2Read.kt +++ b/src/en/hentai2read/src/eu/kanade/tachiyomi/extension/en/hentai2read/Hentai2Read.kt @@ -90,7 +90,7 @@ class Hentai2Read : ParsedHttpSource() { is ReleaseYearSelect -> add("cbo_wpm_pag_mng_sch_rls_yer", filter.state.toString()) is Status -> add("rad_wpm_pag_mng_sch_sts", filter.state.toString()) is TagSearchMode -> add("rad_wpm_pag_mng_sch_tag_mde", arrayOf("and", "or")[filter.state]) - is TagList -> filter.state.forEach { tag -> + is TagList -> filter.state.forEach { tag -> when (tag.state) { Filter.TriState.STATE_INCLUDE -> add("chk_wpm_pag_mng_sch_mng_tag_inc[]", tag.id.toString()) Filter.TriState.STATE_EXCLUDE -> add("chk_wpm_pag_mng_sch_mng_tag_exc[]", tag.id.toString()) @@ -194,7 +194,7 @@ class Hentai2Read : ParsedHttpSource() { override fun pageListParse(response: Response): List { val pages = mutableListOf() - val m = pagesUrlPattern.matcher(response.body().string()) + val m = pagesUrlPattern.matcher(response.body()!!.string()) var i = 0 while (m.find()) { m.group(1).split(",").forEach { diff --git a/src/en/mangacow/src/eu/kanade/tachiyomi/extension/en/mangacow/Mangacow.kt b/src/en/mangacow/src/eu/kanade/tachiyomi/extension/en/mangacow/Mangacow.kt index 2da7d612e..ebecb9dcf 100644 --- a/src/en/mangacow/src/eu/kanade/tachiyomi/extension/en/mangacow/Mangacow.kt +++ b/src/en/mangacow/src/eu/kanade/tachiyomi/extension/en/mangacow/Mangacow.kt @@ -145,7 +145,7 @@ class Mangacow : ParsedHttpSource() { override fun pageListParse(response: Response): List { val pages = mutableListOf() - val m = pagesUrlPattern.matcher(response.body().string()) + val m = pagesUrlPattern.matcher(response.body()!!.string()) var i = 0 while (m.find()) { pages.add(Page(i++, "", m.group(1))) @@ -162,4 +162,4 @@ class Mangacow : ParsedHttpSource() { override fun imageUrlParse(document: Document) = "" override fun getFilterList() = FilterList() -} \ No newline at end of file +} diff --git a/src/en/mangaeden/src/eu/kanade/tachiyomi/extension/en/mangaeden/Mangaeden.kt b/src/en/mangaeden/src/eu/kanade/tachiyomi/extension/en/mangaeden/Mangaeden.kt index dc3b4d912..203684eb1 100644 --- a/src/en/mangaeden/src/eu/kanade/tachiyomi/extension/en/mangaeden/Mangaeden.kt +++ b/src/en/mangaeden/src/eu/kanade/tachiyomi/extension/en/mangaeden/Mangaeden.kt @@ -38,7 +38,7 @@ class Mangaeden : ParsedHttpSource() { override fun popularMangaNextPageSelector() = searchMangaNextPageSelector() override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { - val url = HttpUrl.parse("$baseUrl/en/en-directory/").newBuilder().addQueryParameter("title", query) + val url = HttpUrl.parse("$baseUrl/en/en-directory/")?.newBuilder()!!.addQueryParameter("title", query) (if (filters.isEmpty()) getFilterList() else filters).forEach { filter -> when (filter) { is StatusList -> filter.state @@ -200,4 +200,4 @@ class Mangaeden : ParsedHttpSource() { Genre("Yaoi", "4e70e91ac092255ef70016e5"), Genre("Yuri", "4e70e92ac092255ef7001a57") ) -} \ No newline at end of file +} diff --git a/src/en/mangazuki/src/eu/kanade/tachiyomi/extension/en/mangazuki/Mangazuki.kt b/src/en/mangazuki/src/eu/kanade/tachiyomi/extension/en/mangazuki/Mangazuki.kt index 025d095ce..284128e29 100644 --- a/src/en/mangazuki/src/eu/kanade/tachiyomi/extension/en/mangazuki/Mangazuki.kt +++ b/src/en/mangazuki/src/eu/kanade/tachiyomi/extension/en/mangazuki/Mangazuki.kt @@ -58,8 +58,7 @@ class Mangazuki : ParsedHttpSource() { override fun latestUpdatesNextPageSelector() = null override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { - val url = HttpUrl.parse("$baseUrl/manga-list").newBuilder() - + val url = HttpUrl.parse("$baseUrl/manga-list")?.newBuilder()!! return GET(url.toString(), headers) } override fun searchMangaSelector() = popularMangaSelector() @@ -129,4 +128,4 @@ class Mangazuki : ParsedHttpSource() { override fun pageListParse(document: Document) = document.select("div#all > img").mapIndexed { i, element -> Page(i, "", element.attr("data-src")) } override fun imageUrlParse(document: Document) = "" -} \ No newline at end of file +} diff --git a/src/en/perveden/src/eu/kanade/tachiyomi/extension/en/perveden/Perveden.kt b/src/en/perveden/src/eu/kanade/tachiyomi/extension/en/perveden/Perveden.kt index a810b2866..bd0441ed0 100644 --- a/src/en/perveden/src/eu/kanade/tachiyomi/extension/en/perveden/Perveden.kt +++ b/src/en/perveden/src/eu/kanade/tachiyomi/extension/en/perveden/Perveden.kt @@ -38,7 +38,7 @@ class Perveden : ParsedHttpSource() { override fun popularMangaNextPageSelector() = searchMangaNextPageSelector() override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { - val url = HttpUrl.parse("$baseUrl/en/en-directory/").newBuilder().addQueryParameter("title", query) + val url = HttpUrl.parse("$baseUrl/en/en-directory/")?.newBuilder()!!.addQueryParameter("title", query) (if (filters.isEmpty()) getFilterList() else filters).forEach { filter -> when (filter) { is StatusList -> filter.state @@ -1329,4 +1329,4 @@ class Perveden : ParsedHttpSource() { Pair("zero gravity", "5619c9b2719a16502106c0b2"), Pair("zooey", "5875fb34719a16738b9f43ac") ) -} \ No newline at end of file +} diff --git a/src/en/readcomiconline/src/eu/kanade/tachiyomi/extension/en/readcomiconline/Readcomiconline.kt b/src/en/readcomiconline/src/eu/kanade/tachiyomi/extension/en/readcomiconline/Readcomiconline.kt index 3274e7d84..5960136cd 100644 --- a/src/en/readcomiconline/src/eu/kanade/tachiyomi/extension/en/readcomiconline/Readcomiconline.kt +++ b/src/en/readcomiconline/src/eu/kanade/tachiyomi/extension/en/readcomiconline/Readcomiconline.kt @@ -116,7 +116,7 @@ class Readcomiconline : ParsedHttpSource() { val pages = mutableListOf() //language=RegExp val p = Pattern.compile("""lstImages.push\("(.+?)"""") - val m = p.matcher(response.body().string()) + val m = p.matcher(response.body()!!.string()) var i = 0 while (m.find()) { diff --git a/src/en/shoujosense/src/en/kanade/tachiyomi/extension/en/shoujosense/ShoujoSense.kt b/src/en/shoujosense/src/en/kanade/tachiyomi/extension/en/shoujosense/ShoujoSense.kt index ef56d5871..f5a721325 100644 --- a/src/en/shoujosense/src/en/kanade/tachiyomi/extension/en/shoujosense/ShoujoSense.kt +++ b/src/en/shoujosense/src/en/kanade/tachiyomi/extension/en/shoujosense/ShoujoSense.kt @@ -127,7 +127,7 @@ class ShoujoSense : ParsedHttpSource() { override fun pageListRequest(chapter: SChapter) = POST(baseUrl + chapter.url, headers) override fun pageListParse(response: Response): List { - val body = response.body().string() + val body = response.body()!!.string() val pages = mutableListOf() val p = pagesUrlPattern @@ -148,4 +148,4 @@ class ShoujoSense : ParsedHttpSource() { override fun imageUrlRequest(page: Page) = GET(page.url) override fun imageUrlParse(document: Document) = "" -} \ No newline at end of file +} diff --git a/src/en/webtoons/src/eu/kanade/tachiyomi/extension/en/webtoons/Webtoons.kt b/src/en/webtoons/src/eu/kanade/tachiyomi/extension/en/webtoons/Webtoons.kt index 50143e36e..ff19cf31b 100644 --- a/src/en/webtoons/src/eu/kanade/tachiyomi/extension/en/webtoons/Webtoons.kt +++ b/src/en/webtoons/src/eu/kanade/tachiyomi/extension/en/webtoons/Webtoons.kt @@ -78,8 +78,7 @@ class Webtoons : ParsedHttpSource() { override fun latestUpdatesNextPageSelector() = null override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { - val url = HttpUrl.parse("$baseUrl/search?keyword=$query").newBuilder() - + val url = HttpUrl.parse("$baseUrl/search?keyword=$query")?.newBuilder()!! url.addQueryParameter("searchType", "WEBTOON") return GET(url.toString(), headers) } @@ -157,4 +156,4 @@ class Webtoons : ParsedHttpSource() { override fun pageListParse(document: Document) = document.select("div#_imageList > img").mapIndexed { i, element -> Page(i, "", element.attr("data-url")) } override fun imageUrlParse(document: Document) = document.select("img").first().attr("src") -} \ No newline at end of file +} diff --git a/src/it/hentaifantasy/src/eu/kanade/tachiyomi/extension/it/hentaifantasy/HentaiFantasy.kt b/src/it/hentaifantasy/src/eu/kanade/tachiyomi/extension/it/hentaifantasy/HentaiFantasy.kt index 13b4d329c..e6986759d 100644 --- a/src/it/hentaifantasy/src/eu/kanade/tachiyomi/extension/it/hentaifantasy/HentaiFantasy.kt +++ b/src/it/hentaifantasy/src/eu/kanade/tachiyomi/extension/it/hentaifantasy/HentaiFantasy.kt @@ -160,7 +160,7 @@ class HentaiFantasy : ParsedHttpSource() { override fun pageListRequest(chapter: SChapter) = POST(baseUrl + chapter.url, headers) override fun pageListParse(response: Response): List { - val body = response.body().string() + val body = response.body()!!.string() val pages = mutableListOf() val p = pagesUrlPattern @@ -239,4 +239,4 @@ class HentaiFantasy : ParsedHttpSource() { Tag("Yaoi", 22), Tag("Yuri", 14) ) -} \ No newline at end of file +} diff --git a/src/it/mangaeden/src/eu/kanade/tachiyomi/extension/it/mangaeden/Mangaeden.kt b/src/it/mangaeden/src/eu/kanade/tachiyomi/extension/it/mangaeden/Mangaeden.kt index 8b75be2d8..1f01b5747 100644 --- a/src/it/mangaeden/src/eu/kanade/tachiyomi/extension/it/mangaeden/Mangaeden.kt +++ b/src/it/mangaeden/src/eu/kanade/tachiyomi/extension/it/mangaeden/Mangaeden.kt @@ -38,7 +38,7 @@ class Mangaeden : ParsedHttpSource() { override fun popularMangaNextPageSelector() = searchMangaNextPageSelector() override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { - val url = HttpUrl.parse("$baseUrl/it/it-directory/").newBuilder().addQueryParameter("title", query) + val url = HttpUrl.parse("$baseUrl/it/it-directory/")?.newBuilder()!!.addQueryParameter("title", query) (if (filters.isEmpty()) getFilterList() else filters).forEach { filter -> when (filter) { is StatusList -> filter.state @@ -201,4 +201,4 @@ class Mangaeden : ParsedHttpSource() { Genre("Yaoi", "4e70ea8cc092255ef70073de"), Genre("Yuri", "4e70ea9ac092255ef70075d1") ) -} \ No newline at end of file +} diff --git a/src/it/perveden/src/eu/kanade/tachiyomi/extension/it/perveden/Perveden.kt b/src/it/perveden/src/eu/kanade/tachiyomi/extension/it/perveden/Perveden.kt index 6a85ee46c..b9701948c 100644 --- a/src/it/perveden/src/eu/kanade/tachiyomi/extension/it/perveden/Perveden.kt +++ b/src/it/perveden/src/eu/kanade/tachiyomi/extension/it/perveden/Perveden.kt @@ -38,7 +38,7 @@ class Perveden : ParsedHttpSource() { override fun popularMangaNextPageSelector() = searchMangaNextPageSelector() override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { - val url = HttpUrl.parse("$baseUrl/it/it-directory/").newBuilder().addQueryParameter("title", query) + val url = HttpUrl.parse("$baseUrl/it/it-directory/")?.newBuilder()!!.addQueryParameter("title", query) (if (filters.isEmpty()) getFilterList() else filters).forEach { filter -> when (filter) { is StatusList -> filter.state @@ -397,4 +397,4 @@ class Perveden : ParsedHttpSource() { Pair("yandere", "577e7295719a168ef96a79e7"), Pair("yuri", "577e6f90719a168e7d256a4c") ) -} \ No newline at end of file +} diff --git a/src/pt/unionmangas/src/eu/kanade/tachiyomi/extension/pt/unionmangas/UnionMangas.kt b/src/pt/unionmangas/src/eu/kanade/tachiyomi/extension/pt/unionmangas/UnionMangas.kt index fa0d42b31..89c0f8684 100644 --- a/src/pt/unionmangas/src/eu/kanade/tachiyomi/extension/pt/unionmangas/UnionMangas.kt +++ b/src/pt/unionmangas/src/eu/kanade/tachiyomi/extension/pt/unionmangas/UnionMangas.kt @@ -126,7 +126,7 @@ class UnionMangas : ParsedHttpSource() { } private fun removeLabel(text: String?): String { - return text!!.substring(text!!.indexOf(":") + 1) + return text!!.substring(text.indexOf(":") + 1) } override fun chapterListSelector() = "div.row.lancamento-linha" diff --git a/src/vi/truyentranhlh/src/eu/kanade/tachiyomi/extension/vi/truyentranhlh/Truyentranhlh.kt b/src/vi/truyentranhlh/src/eu/kanade/tachiyomi/extension/vi/truyentranhlh/Truyentranhlh.kt index 997c6760b..a446b15eb 100644 --- a/src/vi/truyentranhlh/src/eu/kanade/tachiyomi/extension/vi/truyentranhlh/Truyentranhlh.kt +++ b/src/vi/truyentranhlh/src/eu/kanade/tachiyomi/extension/vi/truyentranhlh/Truyentranhlh.kt @@ -39,7 +39,7 @@ class Truyentranhlh : HttpSource() { popularMangaFromElement(element) } - val hasNextPage = popularMangaNextPageSelector()?.let { selector -> + val hasNextPage = popularMangaNextPageSelector().let { selector -> document.select(selector).first() } != null @@ -58,7 +58,7 @@ class Truyentranhlh : HttpSource() { latestUpdatesFromElement(element) } - val hasNextPage = latestUpdatesNextPageSelector()?.let { selector -> + val hasNextPage = latestUpdatesNextPageSelector().let { selector -> document.select(selector).first() } != null @@ -188,4 +188,4 @@ class Truyentranhlh : HttpSource() { override fun imageUrlParse(response: Response): String { return "" } -} \ No newline at end of file +}